cp_heap_unlock(3) - Linux man page

Name

cp_heap_lock, cp_heap_unlock - lock / unlock a heap for transaction like access

Synopsis

#include <cprops/heap.h>

int cp_heap_lock(cp_heap *heap, int type);
int cp_heap_unlock(cp_heap *heap);

Description

Unless the mode bit COLLECTION_MODE_NOSYNC is set, heap operation are synchronized, i.e. prevent simultaneous access from multiple threads. cp_heap_lock is needed to perform a transaction-like operation consisting multiple heap operations that must complete before other threads are allowed access. cp_heap_lock locks the heap so that only the current thread can perform heap operations, and cp_heap_unlock releases the lock.

Return Value

cp_heap_lock and cp_heap_unlock return 0 on success or non-zero on failure.

See Also