embOS实时操作系统 - 临界区

it2022-05-12  57

OS_EnterRegion() Indicates to the OS the beginning of a critical region.

A critical region counter (OS_RegionCnt), which is 0 by default, is incremented so that the routine can be nested.

Interrupts < Fast Interrupt and Normal Interrupt > are not disabled using OS_EnterRegion();

however, disabling interrupts will disable preemptive task switches.

Fast Interrupt : High priority interrupts - May not call embOS API functions

embOS does never disable high priority interrupts 

Normal Interrupt : Low priority interrupts - May call embOS API functions

 

OS_LeaveRegion() Indicates to the OS the end of a critical region.

A critical region counter (OS_RegionCnt), which is 0 by default, is decremented. If this counter reaches 0 again, the critical region ends.

 

转载于:https://www.cnblogs.com/shangdawei/archive/2013/04/04/2999238.html

相关资源:数据结构—成绩单生成器

最新回复(0)