preempt.h 324 B

1234567891011121314151617181920212223
  1. #pragma once
  2. #include <process/process.h>
  3. /**
  4. * @brief 增加自旋锁计数变量
  5. *
  6. */
  7. #define preempt_disable() \
  8. do \
  9. { \
  10. ++(current_pcb->preempt_count);\
  11. } while (0)
  12. /**
  13. * @brief 减少自旋锁计数变量
  14. *
  15. */
  16. #define preempt_enable() \
  17. do \
  18. { \
  19. --(current_pcb->preempt_count);\
  20. }while(0)