ct_schedule

The ct_schedule function invokes the Cheap Threads scheduler.

Prototype:

int ct_schedule( void );

Parameters:

None.

Return Value:

CT_OKAY if successful, or CT_ERROR if not.

Discussion:

The ct_schedule function invokes the scheduler at the heart of Cheap Threads. In turn, the scheduler invokes one or more threads, as described in more detail elsewhere.

The scheduler continues to run until one of the following occurs:

Only in the first case does ct_schedule() return CT_OKAY. In the last case it doesn't return anything. In the other cases it returns CT_ERROR.

Restrictions:

You must define at least one active thread by calling ct_create_thread() before calling ct_schedule().

You may not call ct_schedule() from within a thread.


Home