nrfxlib API 2.7.99
Loading...
Searching...
No Matches

◆ nrf_modem_os_sem_init()

int nrf_modem_os_sem_init ( void **  sem,
unsigned int  initial_count,
unsigned int  limit 
)

#include <nrf_modem/include/nrf_modem_os.h>

Initialize a semaphore.

The function initializes a semaphore and returns its address as an output. If an address of an already allocated semaphore is provided as an input, the allocation part is skipped and the semaphore is only reinitialized.

Parameters
[in,out]semThe address of the semaphore.
initial_countInitial semaphore count.
limitMaximum semaphore count.
Returns
0 on success, a negative errno otherwise.