|
Veritable Lasagna
An Allocator & Data Structure Library for C.
|
#include <pthread.h>
Include dependency graph for vl_srwlock_pthread.c:Functions | |
| vl_srwlock | vlSRWLockNew (void) |
| Creates a new instance of a lock. | |
| void | vlSRWLockDelete (vl_srwlock lock) |
| Deletes the specified lock. | |
| void | vlSRWLockObtainShared (vl_srwlock lock) |
| Obtain a shared lock on the specified lock. | |
| vl_bool_t | vlSRWLockTryObtainShared (vl_srwlock lock) |
| Attempts to obtain a shared lock from the specified lock. | |
| void | vlSRWLockReleaseShared (vl_srwlock lock) |
| Releases a shared lock on the specified lock. | |
| void | vlSRWLockObtainExclusive (vl_srwlock lock) |
| Obtains an exclusive lock on the specified lock. | |
| vl_bool_t | vlSRWLockTryObtainExclusive (vl_srwlock lock) |
| Attempts to obtain an exclusive lock on the specified lock. | |
| void | vlSRWLockReleaseExclusive (vl_srwlock lock) |
| Releases an exclusive lock on the specified lock. | |
| void vlSRWLockDelete | ( | vl_srwlock | lock | ) |
Deletes the specified lock.
NULL (no-op).| lock | The lock handle to delete. |
| vl_srwlock vlSRWLockNew | ( | void | ) |
Creates a new instance of a lock.
vl_srwlock handle and is responsible for calling vlSRWLockDelete.vlSRWLockDelete.VL_SRWLOCK_NULL if the lock could not be created.VL_SRWLOCK_NULL if heap allocation fails or platform-specific initialization fails.NULL on failure.| void vlSRWLockObtainExclusive | ( | vl_srwlock | lock | ) |
Obtains an exclusive lock on the specified lock.
Only a single thread may obtain an exclusive lock at any given time. This is more suitable for write operations.
VL_SRWLOCK_NULL (no-op).| lock | The lock handle. |
| void vlSRWLockObtainShared | ( | vl_srwlock | lock | ) |
Obtain a shared lock on the specified lock.
Multiple threads may obtain a shared lock at any given time. This is more suitable for concurrent read operations.
VL_SRWLOCK_NULL (no-op).| lock | The lock handle. |
| void vlSRWLockReleaseExclusive | ( | vl_srwlock | lock | ) |
Releases an exclusive lock on the specified lock.
VL_SRWLOCK_NULL (no-op).| lock | The lock handle. |
| void vlSRWLockReleaseShared | ( | vl_srwlock | lock | ) |
Releases a shared lock on the specified lock.
VL_SRWLOCK_NULL (no-op).| lock | The lock handle. |
| vl_bool_t vlSRWLockTryObtainExclusive | ( | vl_srwlock | lock | ) |
Attempts to obtain an exclusive lock on the specified lock.
VL_SRWLOCK_NULL (returns VL_FALSE).VL_FALSE if any lock (shared or exclusive) is already held by other threads.VL_TRUE if the exclusive lock was successfully obtained, VL_FALSE otherwise.| lock | The lock handle. |
| vl_bool_t vlSRWLockTryObtainShared | ( | vl_srwlock | lock | ) |
Attempts to obtain a shared lock from the specified lock.
VL_SRWLOCK_NULL (returns VL_FALSE).VL_FALSE if an exclusive lock is already held by another thread.VL_TRUE if the shared lock was successfully obtained, VL_FALSE otherwise.| lock | The lock handle. |