Section: libcprops - cp_hashlist (3)
Updated: OCTOBER 2005
Return to Main Contents
cp_hashlist_rd_lock, cp_hashlist_wrlock - hashlist locking functions
int cp_hashlist_lock(cp_hashlist *list, int type);
int cp_hashlist_unlock(cp_hashlist *list);
int cp_hashlist_rdlock(cp_hashlist *list);
int cp_hashlist_wrlock(cp_hashlist *list);
cp_hashlist_lock attempts a lock of the type given in type.
Possible lock types are COLLECTION_LOCK_READ, which allows other threads
to read concurrently, COLLECTION_LOCK_WRITE, which grants exclusive
access or COLLECTION_LOCK_NONE which has no effect. Unless
COLLECTION_MODE_NOSYNC is set, single list operations are synchronized and do
not require explicit locking. Explicit locking is required for transaction-like
operations where several list operations must complete as a group before
allowing other threads to access the list. Once a thread has obtained the list
lock, subsequent list operations on this thread will not attempt to perform
additional locking, but will attempt locking on other threads. The application
is responsible for performing the correct type of locking - if any changes may
be made to list content, the list must be locked for writing; Otherwise it may
be locked for reading.
releases a lock previously acquired with cp_hashlist_lock.
are the same as calling
locking functions return 0 on success or a non-zero error code on failure.
was instantiated with
or an invalid lock type code was given.
Other error codes may be returned from the underlying synchronization api.
- RETURN VALUE
- SEE ALSO
This document was created by
using the manual pages.
Time: 12:01:45 GMT, May 23, 2006