This module provides abstraction for semaphores, where available.
◆ pj_sem_create()
Create semaphore.
- Parameters
-
| pool | The pool. |
| name | Name to be assigned to the semaphore (for logging purpose) |
| initial | The initial count of the semaphore. |
| max | The maximum count of the semaphore. |
| sem | Pointer to hold the semaphore created. |
- Returns
- PJ_SUCCESS on success, or the error code.
◆ pj_sem_destroy()
Destroy semaphore.
- Parameters
-
- Returns
- PJ_SUCCESS on success, or the error code.
◆ pj_sem_post()
Release semaphore.
- Parameters
-
- Returns
- PJ_SUCCESS on success, or the error code.
◆ pj_sem_trywait()
Try wait for semaphore.
- Parameters
-
- Returns
- PJ_SUCCESS on success, or the error code.
◆ pj_sem_wait()
Wait for semaphore.
- Parameters
-
- Returns
- PJ_SUCCESS on success, or the error code.