|
Veritable Lasagna
An Allocator & Data Structure Library for C.
|
#include <windows.h>
Include dependency graph for vl_mutex_win32.c:Macros | |
| #define | WIN32_LEAN_AND_MEAN |
Functions | |
| vl_mutex | vlMutexNew () |
| Mutex primitives are implemented using the Windows SRWLOCK API. This is due to Win32 mutexes being "heavyweight" and being historically less performant than other comparable APIs within the same process. (E.g, if inter-process sharing isn't needed, then SRWLOCK is a good choice.) | |
| void | vlMutexDelete (vl_mutex mutex) |
| De-initializes and deletes the specified mutex. | |
| void | vlMutexObtain (vl_mutex mutex) |
| Obtains an exclusive lock on the specified mutex. | |
| vl_bool_t | vlMutexTryObtain (vl_mutex mutex) |
| Attempts to obtain an exclusive lock on the specified mutex without blocking. | |
| void | vlMutexRelease (vl_mutex mutex) |
| Releases an exclusive lock on the specified mutex. | |
| #define WIN32_LEAN_AND_MEAN |
| void vlMutexDelete | ( | vl_mutex | mutex | ) |
De-initializes and deletes the specified mutex.
VL_MUTEX_NULL (no-op).| mutex | The mutex handle to delete. |
| vl_mutex vlMutexNew | ( | void | ) |
Mutex primitives are implemented using the Windows SRWLOCK API. This is due to Win32 mutexes being "heavyweight" and being historically less performant than other comparable APIs within the same process. (E.g, if inter-process sharing isn't needed, then SRWLOCK is a good choice.)
Creates a new instance of a mutex.
| void vlMutexObtain | ( | 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.
VL_MUTEX_NULL (no-op).| mutex | The mutex handle. |
| void vlMutexRelease | ( | vl_mutex | mutex | ) |
Releases an exclusive lock on the specified mutex.
VL_MUTEX_NULL (no-op).| mutex | The mutex handle. |
Attempts to obtain an exclusive lock on the specified mutex without blocking.
VL_MUTEX_NULL (returns VL_FALSE).VL_FALSE if the lock is already held by another thread.VL_TRUE if the lock was successfully obtained, VL_FALSE otherwise.| mutex | The mutex handle. |