embOS实时操作系统 - 临界区

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.

 

你可能感兴趣的:(操作系统)