2022-04-13 03:14:49 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <process/process.h>
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 增加自旋锁计数变量
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
#define preempt_disable() \
|
|
|
|
|
do \
|
|
|
|
|
{ \
|
2022-06-09 08:27:55 +00:00
|
|
|
++(current_pcb->preempt_count);\
|
2022-04-13 03:14:49 +00:00
|
|
|
} while (0)
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 减少自旋锁计数变量
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
#define preempt_enable() \
|
|
|
|
|
do \
|
|
|
|
|
{ \
|
2022-06-09 08:27:55 +00:00
|
|
|
--(current_pcb->preempt_count);\
|
2022-04-13 03:14:49 +00:00
|
|
|
}while(0)
|