Asterisk - The Open Source Telephony Project  21.4.1
Data Structures | Macros | Functions | Variables
named_locks.c File Reference

Named Locks. More...

#include "asterisk.h"
#include "asterisk/_private.h"
#include "asterisk/astobj2.h"
#include "asterisk/named_locks.h"
#include "asterisk/utils.h"

Go to the source code of this file.

Data Structures

struct  ast_named_lock
 
struct  named_lock_proxy
 

Macros

#define NAMED_LOCKS_BUCKETS   101
 

Functions

struct ast_named_lock__ast_named_lock_get (const char *filename, int lineno, const char *func, enum ast_named_lock_type lock_type, const char *keyspace, const char *key)
 
int ast_named_locks_init (void)
 
static void named_lock_proxy_cb (void *weakproxy, void *data)
 
static void named_locks_shutdown (void)
 

Variables

struct ao2_containernamed_locks
 

Detailed Description

Named Locks.

Author
George Joseph georg.nosp@m.e.jo.nosp@m.seph@.nosp@m.fair.nosp@m.view5.nosp@m..com

Definition in file named_locks.c.

Function Documentation

int ast_named_locks_init ( void  )

Provided by named_locks.c

Definition at line 52 of file named_locks.c.

References AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_hash, and ast_register_cleanup().

53 {
55  NAMED_LOCKS_BUCKETS, named_lock_proxy_hash_fn, NULL, named_lock_proxy_cmp_fn);
56  if (!named_locks) {
57  return -1;
58  }
59 
60  ast_register_cleanup(named_locks_shutdown);
61 
62  return 0;
63 }
int ast_register_cleanup(void(*func)(void))
Register a function to be executed before Asterisk gracefully exits.
Definition: clicompat.c:19
#define ao2_container_alloc_hash(ao2_options, container_options, n_buckets, hash_fn, sort_fn, cmp_fn)
Allocate and initialize a hash container with the desired number of buckets.
Definition: astobj2.h:1303