增加锁的持有计数

This commit is contained in:
fslongjin
2022-04-13 11:14:49 +08:00
parent ac28a3c806
commit 7295565e5e
4 changed files with 100 additions and 38 deletions

23
kernel/process/preempt.h Normal file
View File

@ -0,0 +1,23 @@
#pragma once
#include <process/process.h>
/**
* @brief 增加自旋锁计数变量
*
*/
#define preempt_disable() \
do \
{ \
--(current_pcb->preempt_count);\
} while (0)
/**
* @brief 减少自旋锁计数变量
*
*/
#define preempt_enable() \
do \
{ \
++(current_pcb->preempt_count);\
}while(0)