Go to the source code of this file.
◆ VL_MUTEX_NULL
◆ vlMutexObtain
◆ vlMutexRelease
Releases an exclusive lock on the specified mutex.
- Parameters
-
◆ vl_mutex
Mutex handle.
In Veritable Lasagna, Mutexes are defined as Read-Write locks. They offer both "shared" and "exclusive" modes; the former is usable for read operations, while the latter is suitable for write operations.
If the mutex is locked in "shared" mode, other areas of code are permitted to read whatever shared resource. In "exclusive" mode, the behavior is identical to that of a typical mutex: anything trying to obtain the lock in either shared or exclusive mode must wait for its availability.
If trying to obtain an exclusive lock while other thread(s) have already obtained shared locks, the exclusive lock must wait until all other shared locks are released.
◆ vlMutexDelete()
Deletes the specified mutex.
- Warning
- Be certain the mutex is no longer obtained by the time this function is called.
◆ vlMutexNew()
Creates a new instance of a mutex.
- Note
- May return VL_MUTEX_NULL on failure.
- Returns
- mutex handle
◆ vlMutexObtainExclusive()
void vlMutexObtainExclusive |
( |
vl_mutex | mutex | ) |
|
Obtains an exclusive lock on the specified mutex.
Only a single thread may obtain an exclusive lock at any given time. This is more suitable for write operations.
- Parameters
-
◆ vlMutexObtainShared()
void vlMutexObtainShared |
( |
vl_mutex | mutex | ) |
|
Obtain a shared lock on the specified mutex.
Multiple threads may obtain a shared lock at any given time. This is more suitable for concurrent read operations.
- Parameters
-
◆ vlMutexReleaseExclusive()
void vlMutexReleaseExclusive |
( |
vl_mutex | mutex | ) |
|
Releases an exclusive lock on the specified mutex.
- Parameters
-
◆ vlMutexReleaseShared()
void vlMutexReleaseShared |
( |
vl_mutex | mutex | ) |
|
Releases a shared lock on the specified mutex.
- Parameters
-
◆ vlMutexTryObtainExclusive()
Attempts to obtain an exclusive lock on the specified mutex.
- Note
- This function is non-blocking.
- Parameters
-
- Returns
- a boolean indicating whether or not the lock was obtained.
◆ vlMutexTryObtainShared()
Attempts to obtain a shared lock from the specified mutex.
- Note
- This function is non-blocking.
- Parameters
-
- Returns
- a boolean indicating whether or not the shared lock was obtained