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

函数

int osal_atomic_read (osal_atomic *atomic)
 read atomic variable
 
void osal_atomic_set (osal_atomic *atomic, int i)
 set atomic variable
 
int osal_atomic_inc_return (osal_atomic *atomic)
 increment atomic variable and return
 
int osal_atomic_add_return (osal_atomic *atomic, int count)
 Adds the given value to the atomic variable and returns the increased result.
 
int osal_atomic_dec_return (osal_atomic *atomic)
 decrement atomic variable and return
 
void osal_atomic_inc (osal_atomic *atomic)
 increment atomic variable
 
void osal_atomic_sub (osal_atomic *atomic, unsigned int count)
 Reduce a fixed number of atomic variables.
 
void osal_atomic_dec (osal_atomic *atomic)
 decrement atomic variable
 
void osal_atomic_add (osal_atomic *atomic, int count)
 Add a fixed number of atomic variables.
 
int osal_atomic_dec_and_test (osal_atomic *atomic)
 decrement atomic variable and test
 
int osal_atomic_inc_and_test (osal_atomic *atomic)
 increment atomic variable and test
 
int osal_atomic_inc_not_zero (osal_atomic *atomic)
 increment unless the number is zero
 

详细描述

函数说明

◆ osal_atomic_add()

void osal_atomic_add ( osal_atomic atomic,
int  count 
)

Add a fixed number of atomic variables.

Description:
Add a fixed number of atomic variables
参数
atomic[in] The atomic to be change.
count[in] Number of atomic variables to be add.
Support System:
freertos.

◆ osal_atomic_add_return()

int osal_atomic_add_return ( osal_atomic atomic,
int  count 
)

Adds the given value to the atomic variable and returns the increased result.

Description:
Adds the given value to the atomic variable and returns the increased result.
参数
atomic[in] The atomic to be change.
count[in] Number of atomic variables to be add.
Support System:
freertos.

◆ osal_atomic_dec()

void osal_atomic_dec ( osal_atomic atomic)

decrement atomic variable

Description:
This API is used to implement the atomic self-decrement.
Support System:
linux liteos freertos.

◆ osal_atomic_dec_and_test()

int osal_atomic_dec_and_test ( osal_atomic atomic)

decrement atomic variable and test

Description:
This API is used to subtract 1 atomically from the variable atomic of the atomic type and checks whether the result is 0. If yes, true is returned. Otherwise, false is returned.
Support System:
linux.

◆ osal_atomic_dec_return()

int osal_atomic_dec_return ( osal_atomic atomic)

decrement atomic variable and return

Description:
This API is used to implement the atomic self-decrement and return the self-decrement result.
Support System:
linux liteos freertos.

◆ osal_atomic_inc()

void osal_atomic_inc ( osal_atomic atomic)

increment atomic variable

Description:
This API is used to implement the atomic self-addition.
Support System:
linux liteos freertos.

◆ osal_atomic_inc_and_test()

int osal_atomic_inc_and_test ( osal_atomic atomic)

increment atomic variable and test

Description:
This API is used to add 1 atomically from the variable atomic of the atomic type and checks whether the result is 0. If yes, true is returned. Otherwise, false is returned.
Support System:
linux.

◆ osal_atomic_inc_not_zero()

int osal_atomic_inc_not_zero ( osal_atomic atomic)

increment unless the number is zero

Description:
Atomically increments atomic by 1, if atomic is non-zero.
返回
Returns true if the increment was done.
Support System:
linux.

◆ osal_atomic_inc_return()

int osal_atomic_inc_return ( osal_atomic atomic)

increment atomic variable and return

Description:
This API is used to implement the atomic self-addition and return the self-addition result.
Support System:
linux liteos freertos.

◆ osal_atomic_read()

int osal_atomic_read ( osal_atomic atomic)

read atomic variable

Description:
This API is used to implement the atomic read and return the value read from the input parameter atomic.
Support System:
linux liteos freertos.

◆ osal_atomic_set()

void osal_atomic_set ( osal_atomic atomic,
int  i 
)

set atomic variable

Description:
This API is used to implement the atomic setting operation.
Support System:
linux liteos freertos.

◆ osal_atomic_sub()

void osal_atomic_sub ( osal_atomic atomic,
unsigned int  count 
)

Reduce a fixed number of atomic variables.

Description:
Reduce a fixed number of atomic variables
参数
atomic[in] The atomic to be change.
count[in] Number of atomic variables to be reduced.
Support System:
freertos.