Forbid task scheduling.
Source position: exec.pas line 1766
procedure Forbid; |
Prevents other tasks from being scheduled to run by the dispatcher, until a matching Permit() is executed, or this task is scheduled to Wait(). Interrupts are not disabled.
The current task will not be rescheduled as long as it is ready to run. In the event that the current task enters a wait state, other tasks may be scheduled. Upon return from the wait state, the original task will continue to run without disturbing the Forbid().
Calls to Forbid() nest. In order to restore normal task rescheduling, the programmer must execute exactly one call to Permit() for every call to Forbid().
Warning:
In the event of a task entering a Wait() after a Forbid(), the system "breaks" the forbidden state and runs normally until the task which called Forbid() is rescheduled. If caution is not taken, this can cause subtile bugs, since any device or DOS call will (in effect) cause your task to wait.
|
Permit task rescheduling. |
|
|
Disable interrupt processing |
|
|
Enable interrupt processing |