# OS_EnableScheduler

## C Specification

      #include <nitro/os.h>

      u32 OS_EnableScheduler( void );

## Arguments

None.

## Return Values

The internal counter value after canceling the suppression of the scheduler operation.

When this value is larger than 0, the scheduler operation is suppressed.

## Description

Cancels the suppressed operation of the thread system scheduler. In other words, rescheduling will be resumed.

If the operation of the thread system scheduler is suppressed, the rescheduling of the thread will not occur, even when the functions such as `OS_WakeupThread` and `OS_SetThreadPriority` that have the possibility of generating the rescheduling of threads are called.

Normally, this `OS_EnableScheduler` is called with `OS_DisableScheduler()` as a pair.

Call `OS_DisableScheduler` and `OS_EnableScheduler` while the interrupts are prohibited.

The scheduler has the internal counter. That counter, which is normally set to 0, increments by one with `OS_DisableScheduler` and decrements by one with `OS_EnableScheduler`. In addition, if it is larger than 0, this prevents rescheduling. The return value from this function is the value after the counter has changed. If it is larger than 0, it is the state that has not yet rescheduled.

A set of `OS_DisableScheduler` and `OS_EnableScheduler` as a pair can be nested. For an example see the reference for `OS_DisableScheduler()`.

## See Also

`OS_SelectThread, OS_RescheduleThread, OS_DisableScheduler`

## Revision History

03/08/2005 Standardized the Japanese term for "interrupt"
01/21/2005 Initial version