For more details and example usage, see Semaphore
◆ SemaphoreP_OBJECT_SIZE_MAX
#define SemaphoreP_OBJECT_SIZE_MAX (152U) |
Max size of semaphore object across no-RTOS and all OS's.
◆ SemaphoreP_constructMutex()
◆ SemaphoreP_constructBinary()
Create a binary semaphore object.
- Parameters
-
obj | [out] created object |
initValue | [in] Initial value of the binary semaphore, MUST be 0 or 1 |
- Returns
- SystemP_SUCCESS on success, SystemP_FAILURE on error
◆ SemaphoreP_constructCounting()
int32_t SemaphoreP_constructCounting |
( |
SemaphoreP_Object * |
obj, |
|
|
uint32_t |
initValue, |
|
|
uint32_t |
maxValue |
|
) |
| |
Create a counting semaphore object.
- Parameters
-
obj | [out] created object |
initValue | [in] Initial value of the counting semaphore, MUST be between 0 .. maxValue |
maxValue | [in] Maximum value of counting semaphore |
- Returns
- SystemP_SUCCESS on success, SystemP_FAILURE on error
◆ SemaphoreP_destruct()
Cleanup, delete, destruct a semaphore object.
- Parameters
-
◆ SemaphoreP_post()
Post a semaphore object or unlock a mutex.
- Parameters
-
◆ SemaphoreP_pend()
Pend on a semaphore object or lock a mutex.
- Parameters
-
obj | [in] semaphore object |
timeToWaitInTicks | [in] amount of time to block waiting for semaphore to be available, in units of system ticks (see Clock) |
- Returns
- SystemP_SUCCESS on successful acquire of the semaphore
-
SystemP_TIMEOUT on failure to acquire the semaphore due to timeout condition
-
SystemP_FAILURE on failure to acquire the semaphore due to other conditions
◆ SemaphoreP_getCount()
Function to return the count of a semaphore.
- Parameters
-
- Returns
- The count of the semaphore