WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
osal_wait

函数

int osal_wait_init (osal_wait *wait)
 Initialize a waiting queue.
 
int osal_wait_interruptible (osal_wait *wait, osal_wait_condition_func func, const void *param)
 sleep until a condition gets true
 
int osal_wait_uninterruptible (osal_wait *wait, osal_wait_condition_func func, const void *param)
 sleep until a condition gets true
 
int osal_wait_timeout_interruptible (osal_wait *wait, osal_wait_condition_func func, const void *param, unsigned long ms)
 sleep until a condition gets true or a timeout elapses.
 
int osal_wait_timeout_uninterruptible (osal_wait *wait, osal_wait_condition_func func, const void *param, unsigned long ms)
 sleep until a condition gets true or a timeout elapses.
 
void osal_wait_wakeup (osal_wait *wait)
 wake up threads blocked on a waitqueue.
 
void osal_wait_wakeup_interruptible (osal_wait *wait)
 wake up threads blocked on a waitqueue.
 
void osal_wait_destroy (osal_wait *wait)
 to destroy the wait.
 

详细描述

函数说明

◆ osal_wait_destroy()

void osal_wait_destroy ( osal_wait wait)

to destroy the wait.

Description:
This API is used to destroy the wait.
参数
wait[in] The wait to be destroyed.
注意
this api may free memory, wait should be from osal_complete_init.
Support System:
linux liteos freertos.

◆ osal_wait_init()

int osal_wait_init ( osal_wait wait)

Initialize a waiting queue.

Description:
This API is used to Initialize a waiting queue.
参数
wait[out] The wait queue to be initialized.
Support System:
linux liteos freertos.

◆ osal_wait_interruptible()

int osal_wait_interruptible ( osal_wait wait,
osal_wait_condition_func  func,
const void *  param 
)

sleep until a condition gets true

Description:
sleep until a condition gets true. The process is put to sleep (TASK_INTERRUPTIBLE) until the func returned true or a signal is received. Return value of the func is checked each time the waitqueue wait is woken up.
注意
wake_up() has to be called after changing any variable that could change the result of the wait condition. it is the same as osal_wait_uninterruptible on LiteOS. LiteOS does not support this interface, so it is the same as osal_wait_uninterruptible on LiteOS.
参数
wait[in] The waitqueue to wait on.
func[in] Then function to be run.
param[in] Param of the function to be run.
返回
OSAL_SUCCESS/OSAL_FAILURE. In linux, The function will return -ERESTARTSYS if it was interrupted by a signal. liteos
Support System:
linux liteos.

◆ osal_wait_timeout_interruptible()

int osal_wait_timeout_interruptible ( osal_wait wait,
osal_wait_condition_func  func,
const void *  param,
unsigned long  ms 
)

sleep until a condition gets true or a timeout elapses.

Description:
sleep until a condition gets true or a timeout elapses. The process is put to sleep (TASK_INTERRUPTIBLE) until the func returned true or a signal is received. Return value of the func is checked each time the waitqueue wait is woken up.
参数
wait[in] the waitqueue to wait on.
func[in] a C expression for the event to wait for.
param[in] Param of the function to be run.
ms[in] timeout, in ms.
Support System:
linux liteos freertos.
Description: same as from liteos
This API is used to sleep a process until the condition evaluates to true or a timeout elapses. The condition is checked each time when the waitqueue wait is woken up.
注意
The value range of parameter timeout is [0, 0xFFFFFFFF], and 0xFFFFFFFF means waiting forever.
参数
wait[IN] the waitqueue to wait on.
condition[IN] a condition evaluates to true or false.
timeout[IN] the max sleep time unit is ms.
返回值
#0return 0 if the condition evaluated to false after the timeout elapsed
#1return 1 if the condition evaluated to true after the timeout elapsed
#othersreturn the remaining ticks if the condition evaluated to true before the timeout elapsed

◆ osal_wait_timeout_uninterruptible()

int osal_wait_timeout_uninterruptible ( osal_wait wait,
osal_wait_condition_func  func,
const void *  param,
unsigned long  ms 
)

sleep until a condition gets true or a timeout elapses.

Description:
sleep until a condition gets true or a timeout elapses. The process is put to sleep (TASK_UNINTERRUPTIBLE) until the func returned true. Return value of the func is checked each time the waitqueue wait is woken up.
参数
wait[in] The waitqueue to wait on.
func[in] A C expression for the event to wait for.
param[in] Param of the function to be run.
ms[in] Timeout, in ms.
Support System:
linux liteos.

◆ osal_wait_uninterruptible()

int osal_wait_uninterruptible ( osal_wait wait,
osal_wait_condition_func  func,
const void *  param 
)

sleep until a condition gets true

Description:
sleep until a condition gets true. The process is put to sleep (TASK_UNINTERRUPTIBLE) until the func returned true. Return value of the func is checked each time the waitqueue wait is woken up.
注意
wake_up() has to be called after changing any variable that could change the result of the wait condition.
返回
OSAL_SUCCESS/OSAL_FAILURE
Support System:
linux liteos freetos.

◆ osal_wait_wakeup()

void osal_wait_wakeup ( osal_wait wait)

wake up threads blocked on a waitqueue.

Description:
Wake-up wait queue,pair to wait_event.
参数
wait[in] The wait to be wake up.
Support System:
linux liteos freertos.

◆ osal_wait_wakeup_interruptible()

void osal_wait_wakeup_interruptible ( osal_wait wait)

wake up threads blocked on a waitqueue.

Description:
Wake-up wait queue,pair to wait_event_interruptible.
参数
wait[in] The wait to be wake up.
Support System:
linux liteos.