lwIP  2.0.2
Lightweight IP stack

Functions

err_t sys_sem_new (sys_sem_t *sem, u8_t count)
 
void sys_sem_signal (sys_sem_t *sem)
 
u32_t sys_arch_sem_wait (sys_sem_t *sem, u32_t timeout)
 
void sys_sem_free (sys_sem_t *sem)
 
int sys_sem_valid (sys_sem_t *sem)
 
void sys_sem_set_invalid (sys_sem_t *sem)
 

Detailed Description

Function Documentation

◆ sys_arch_sem_wait()

u32_t sys_arch_sem_wait ( sys_sem_t *  sem,
u32_t  timeout 
)

Wait for a semaphore for the specified timeout

Parameters
semthe semaphore to wait for
timeouttimeout in milliseconds to wait (0 = wait forever)
Returns
time (in milliseconds) waited for the semaphore or SYS_ARCH_TIMEOUT on timeout

◆ sys_sem_free()

void sys_sem_free ( sys_sem_t *  sem)

Delete a semaphore

Parameters
semsemaphore to delete

◆ sys_sem_new()

err_t sys_sem_new ( sys_sem_t *  sem,
u8_t  count 
)

Create a new semaphore

Parameters
sempointer to the semaphore to create
countinitial count of the semaphore
Returns
ERR_OK if successful, another err_t otherwise

◆ sys_sem_set_invalid()

void sys_sem_set_invalid ( sys_sem_t *  sem)

Set a semaphore invalid so that sys_sem_valid returns 0

◆ sys_sem_signal()

void sys_sem_signal ( sys_sem_t *  sem)

Signals a semaphore

Parameters
semthe semaphore to signal

◆ sys_sem_valid()

int sys_sem_valid ( sys_sem_t *  sem)

Check if a semaphore is valid/allocated: return 1 for valid, 0 for invalid