lock_ops.h File Reference
Kamailio locking operations.
More...
Go to the source code of this file.
Detailed Description
Kamailio locking operations.
Implements simple locks and lock sets.
simple locks:
- 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_get(gen_lock_t* lock); - lock (mutex down)
- void lock_release(gen_lock_t* lock); - unlock (mutex up)
lock sets: [implemented only for FL & SYSV so far]
- 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_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)
- Note:
- Warning: do not include this file directly, use instead locking.h (unless you don't need to alloc/dealloc locks).
- Todo:
- investigate futex support on linux
Definition in file lock_ops.h.