locking.h File Reference
Kamailio locking library.
More...
#include "lock_ops.h"
#include "lock_alloc.h"
Go to the source code of this file.
Detailed Description
Kamailio locking library.
Implements (in lock_ops.h & lock_alloc.h):
simple locks:
- type: gen_lock_t
- gen_lock_t* lock_alloc(); - allocates a lock in shared mem.
- gen_lock_t* lock_init(gen_lock_t* lock); - inits the lock
- void lock_destroy(gen_lock_t* lock); - removes the lock (e.g sysv rmid)
- void lock_dealloc(gen_lock_t* lock); - deallocates the lock's shared m.
- void lock_get(gen_lock_t* lock); - lock (mutex down)
- void lock_release(gen_lock_t* lock); - unlock (mutex up)
lock sets:
- type: gen_lock_set_t
- gen_lock_set_t* lock_set_alloc(no) - allocs a lock set in shm.
- gen_lock_set_t* lock_set_init(gen_lock_set_t* set); - inits the lock set
- void lock_set_destroy(gen_lock_set_t* s); - removes the lock set
- void lock_set_dealloc(gen_lock_set_t* s); - deallocs the lock set shm.
- void lock_set_get(gen_lock_set_t* s, int i); - locks sem i from the set
- void lock_set_release(gen_lock_set_t* s, int i)- unlocks sem i from the set
WARNING:
- lock_set_init may fail for large number of sems (e.g. sysv).
- signals are not treated! (some locks are "awakened" by the signals)
Definition in file locking.h.