物联网操作系统AliOS Things 3.3
自旋锁

结构体

struct  aos_spinlock_t
 

类型定义

typedef long aos_irqsave_t
 

函数

void aos_spin_lock_init (aos_spinlock_t *spinlock)
 
void aos_spin_lock (aos_spinlock_t *spinlock)
 
void aos_spin_unlock (aos_spinlock_t *spinlock)
 
aos_irqsave_t aos_spin_lock_irqsave (aos_spinlock_t *spinlock)
 
void aos_spin_unlock_irqrestore (aos_spinlock_t *spinlock, aos_irqsave_t flag)
 

详细描述

提供AliOS Things系统内核自旋锁功能的基础API.

类型定义说明

◆ aos_irqsave_t

typedef long aos_irqsave_t

在文件 kernel.h183 行定义.

函数说明

◆ aos_spin_lock()

void aos_spin_lock(aos_spinlock_tspinlock)

Lock a spinlock.

参数
[in]spinlockspinlock object.

◆ aos_spin_lock_init()

void aos_spin_lock_init(aos_spinlock_tspinlock)

Init a spinlock.

参数
[in]spinlockpointer of spinlock object,spinlock object must be alloced.

◆ aos_spin_lock_irqsave()

aos_irqsave_t aos_spin_lock_irqsave(aos_spinlock_tspinlock)

Lock a spinlock in ISR.

参数
[in]spinlockspinlock object.
返回
CPSR value.

◆ aos_spin_unlock()

void aos_spin_unlock(aos_spinlock_tspinlock)

Unlock a spinlock.

参数
[in]spinlockspinlock object.

◆ aos_spin_unlock_irqrestore()

void aos_spin_unlock_irqrestore(aos_spinlock_tspinlock,
aos_irqsave_t flag 
)

Unlock a spinlock in ISR.

参数
[in]spinlockspinlock object.
[in]flagCPSR value.