Veritable Lasagna
An Allocator & Data Structure Library for C.
Loading...
Searching...
No Matches
vl_semaphore.h
Go to the documentation of this file.
1
14#ifndef VL_SEMAPHORE_H
15#define VL_SEMAPHORE_H
16
17#include "vl_numtypes.h"
18
25typedef struct vl_semaphore_* vl_semaphore;
26
45VL_API vl_semaphore vlSemaphoreNew(vl_uint_t initialCount);
46
62VL_API void vlSemaphoreDelete(vl_semaphore sem);
63
86VL_API vl_bool_t vlSemaphoreWait(vl_semaphore sem, vl_uint_t timeoutMs);
87
105VL_API void vlSemaphorePost(vl_semaphore sem);
106
123VL_API vl_bool_t vlSemaphoreTryWait(vl_semaphore sem);
124
142VL_API vl_uint_t vlSemaphoreGetCount(vl_semaphore sem);
143
144#endif // VL_SEMAPHORE_H
VL_UINT_T vl_uint_t
Standard unsigned integer type.
Definition vl_numtypes.h:158
VL_BOOL_T vl_bool_t
Definition vl_numtypes.h:191
VL_API vl_bool_t vlSemaphoreTryWait(vl_semaphore sem)
Attempts to decrement (acquire) the semaphore without blocking.
Definition vl_semaphore_pthread.c:51
VL_API vl_uint_t vlSemaphoreGetCount(vl_semaphore sem)
Gets the current semaphore count.
Definition vl_semaphore_pthread.c:53
VL_API void vlSemaphorePost(vl_semaphore sem)
Increments (releases) the semaphore count.
Definition vl_semaphore_pthread.c:49
VL_API vl_semaphore vlSemaphoreNew(vl_uint_t initialCount)
Creates a new semaphore with the specified initial count.
Definition vl_semaphore_pthread.c:6
VL_API vl_bool_t vlSemaphoreWait(vl_semaphore sem, vl_uint_t timeoutMs)
Decrements (acquires) the semaphore count.
Definition vl_semaphore_pthread.c:30
VL_API void vlSemaphoreDelete(vl_semaphore sem)
Deletes a semaphore handle and releases associated resources.
Definition vl_semaphore_pthread.c:24