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

结构体

struct  Spinlock
 

宏定义

#define SPIN_LOCK_INIT(lock)   SPIN_LOCK_S lock = SPIN_LOCK_INITIALIZER(lock)
 

详细描述

宏定义说明

◆ SPIN_LOCK_INIT

#define SPIN_LOCK_INIT (   lock)    SPIN_LOCK_S lock = SPIN_LOCK_INITIALIZER(lock)
  • This macro is used to define the input parameter lock as a spinlock, and initialize the spinlock statically.
  • This macro has no return value.
  • Note that the input parameter lock does not need to be defined before calling this macro. Otherwise, the variable lock is repeatedly defined.
  • On Non-SMP (UP) mode, this macro has no effect.
  • The spinlock is advised to protect operation that take a short time. Otherwise, the overall system performance may be affected because the thread exits the waiting loop only after the spinlock is obtained. For time-consuming operation, the mutex lock can be used instead of spinlock.