libcmutils 0.6.5
Multi-platform C99 utility library
Loading...
Searching...
No Matches
CMUTIL_Semaphore Struct Reference

Platform independent semaphore object. More...

Data Fields

CMBool(* Acquire )(CMUTIL_Semaphore *semaphore, long millisec)
 Acquire ownership from semaphore.
 
void(* Release )(CMUTIL_Semaphore *semaphore)
 Release ownership to semaphore.
 
void(* Destroy )(CMUTIL_Semaphore *semaphore)
 Destroy all resources related to this object.
 

Detailed Description

Platform independent semaphore object.

Field Documentation

◆ Acquire

CMBool(* CMUTIL_Semaphore::Acquire) (CMUTIL_Semaphore *semaphore, long millisec)

Acquire ownership from semaphore.

Acquire ownership in the given time or fail with timed out. This method will be blocked until ownership is acquired successfully in time, or the waiting time expired.

Parameters
semaphoreThis semaphore object.
millisecWaiting time to acquire ownership, in millisecond.
Returns
CMTrue if ownership acquired successfully in time, CMFalse if failed to acquire ownership in time.

◆ Release

void(* CMUTIL_Semaphore::Release) (CMUTIL_Semaphore *semaphore)

Release ownership to semaphore.

Release ownership to semaphore, the semaphore value increased greater than zero consequently, one of the threads which is blocked in the Acquire method will get the ownership and be unblocked.

Parameters
semaphoreThis semaphore object.

◆ Destroy

void(* CMUTIL_Semaphore::Destroy) (CMUTIL_Semaphore *semaphore)

Destroy all resources related to this object.

Parameters
semaphoreThis semaphore object.

The documentation for this struct was generated from the following file: