next up previous contents
Next: Resetting & Deleting thread Up: Scheduler API Previous: Heir Thread   Contents

Changing Thread Status

     oskit_u32_t (*set_mode)(struct tcb *,oskit_u32_t)
set_mode() is called by the rtker to change the status of a thread.The argument passed to set_mode is either of THREAD_BLOCKED , THREAD_SUSPENDED or THREAD_READY. The scheduler should change the status field of the thread appropriately & possibly update it's data structure. The kernel does not require the scheduler to keep track of blocked or suspended threads.

Note :
THREAD_BLOCKED is made different from THREAD_SUSPENDED because only a suspended thread can be resumed by the thread_resume() system call. On the other hand a thread could be blocked waiting for a semaphore. Such a thread cannot be resumed until the semaphore is available.



Soumyadeb Mitra 2002-08-07