lock.c File Reference

TM :: Locking functions. More...

#include <errno.h>
#include "lock.h"
#include "timer.h"
#include "../../dprint.h"

Include dependency graph for lock.c:

Go to the source code of this file.

Defines

#define SEM_MAX   4096
#define SEM_MIN   16

Functions

int init_cell_lock (struct cell *cell)
int init_entry_lock (struct s_table *ht, struct entry *entry)
int init_timerlist_lock (enum lists timerlist_id)
void lock_cleanup ()
 remove the semaphore set from system
int lock_initialize (void)
 Initialize the locks.

Variables

gen_lock_set_t * entry_semaphore = 0
gen_lock_set_t * reply_semaphore = 0
static int sem_nr
static ser_lock_ttimer_group_lock = 0
gen_lock_set_t * timer_semaphore = 0


Detailed Description

TM :: Locking functions.

Definition in file lock.c.


Define Documentation

#define SEM_MAX   4096

Definition at line 47 of file lock.c.

Referenced by lock_initialize().

#define SEM_MIN   16

Definition at line 46 of file lock.c.

Referenced by lock_initialize().


Function Documentation

int init_cell_lock ( struct cell cell  ) 

int init_entry_lock ( struct s_table ht,
struct entry entry 
)

int init_timerlist_lock ( enum lists  timerlist_id  ) 

Definition at line 261 of file lock.c.

References get_timertable(), timer::mutex, timer_group, and timer_table::timers.

Referenced by init_timer_list().

void lock_cleanup ( void   ) 

remove the semaphore set from system

Definition at line 204 of file lock.c.

References entry_semaphore, reply_semaphore, shm_free, and timer_semaphore.

Referenced by lock_initialize(), and tm_shutdown().

int lock_initialize ( void   ) 

Initialize the locks.

Returns:
0 on success, -1 otherwise

Definition at line 84 of file lock.c.

References entry_semaphore, LM_CRIT, LM_DBG, LM_INFO, lock_cleanup(), reply_semaphore, SEM_MAX, SEM_MIN, sem_nr, ser_lock_t::semaphore_index, ser_lock_t::semaphore_set, shm_malloc(), TG_NR, timer_group, and timer_semaphore.

Referenced by init_hash_table().


Variable Documentation

gen_lock_set_t* entry_semaphore = 0

Definition at line 71 of file lock.c.

Referenced by init_entry_lock(), lock_cleanup(), and lock_initialize().

gen_lock_set_t* reply_semaphore = 0

Definition at line 72 of file lock.c.

Referenced by init_cell_lock(), lock_cleanup(), and lock_initialize().

int sem_nr [static]

and the maximum number of semaphores in the entry_semaphore set

Definition at line 69 of file lock.c.

Referenced by init_cell_lock(), init_entry_lock(), and lock_initialize().

timer group locks pointer to a TG_NR lock array, it's safer if we alloc this in shared mem ( required for fast lock )

Definition at line 76 of file lock.c.

gen_lock_set_t* timer_semaphore = 0

Definition at line 70 of file lock.c.

Referenced by lock_cleanup(), and lock_initialize().


Generated on Wed May 23 18:00:41 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6