![]() |
kinetic-c
v0.12.0
Seagate Kinetic Protocol Client Library for C
|
Go to the source code of this file.
Functions | |
KineticSemaphore * | KineticSemaphore_Create (void) |
Creates a KineticSemaphore. More... | |
void | KineticSemaphore_Signal (KineticSemaphore *sem) |
Signals KineticSemaphore. More... | |
bool | KineticSemaphore_CheckSignaled (KineticSemaphore *sem) |
Reports whether the KineticSemaphore has been signaled. More... | |
bool | KineticSemaphore_DestroyIfSignaled (KineticSemaphore *sem) |
Destorys the KineticSemaphore if it has been signaled. More... | |
void | KineticSemaphore_WaitForSignalAndDestroy (KineticSemaphore *sem) |
Blocks until the given semaphore is signaled. More... | |
KineticSemaphore* KineticSemaphore_Create | ( | void | ) |
Creates a KineticSemaphore.
The KineticSemaphore is a simple wrapper around a pthread condition variable and provides a a thread-safe way to block a thread and wait for notification from another thread.
Definition at line 31 of file kinetic_semaphore.c.
void KineticSemaphore_Signal | ( | KineticSemaphore * | sem | ) |
Signals KineticSemaphore.
This will unblock another thread that's blocked on the given semaphore using KineticSemaphore_WaitForSignalAndDestroy() You should never signal the same KineticSemaphore more than once.
sem | A pointer to the semaphore to signal. |
Definition at line 43 of file kinetic_semaphore.c.
bool KineticSemaphore_CheckSignaled | ( | KineticSemaphore * | sem | ) |
Reports whether the KineticSemaphore has been signaled.
sem | A pointer to the semaphore to report signaled status from. |
Definition at line 51 of file kinetic_semaphore.c.
bool KineticSemaphore_DestroyIfSignaled | ( | KineticSemaphore * | sem | ) |
Destorys the KineticSemaphore if it has been signaled.
sem | A pointer to the semaphore to destroy. |
Definition at line 56 of file kinetic_semaphore.c.
void KineticSemaphore_WaitForSignalAndDestroy | ( | KineticSemaphore * | sem | ) |
Blocks until the given semaphore is signaled.
This will not block if the Semaphore has already been signaled. Once unblocked, this will also destroy (free) the provide KineticSemaphore.
sem | A pointer to the semaphore to wait for a signal. |
Definition at line 69 of file kinetic_semaphore.c.