Add the complex state TDS_SUSP_SLP.

This state is to allow some experimentation and not YET used..
The theory is that a thread that is about to sleep is placed on the sleep
queue and then discovers it should suspend, and is placed on suspend queue.
(these are separate queues and it can be on both). It will not become runnable
until it has been removed from BOTH queues. i.e. a wakeup event
has occured AND the process has been unsuspended. If it were not on the sleep
queue when suspended, then the (possibly only) wakeup event might arrive and
not find any process to wake up. this would result in the thread
sleeping 'forever' when the suspension is lifted. This state will
transition to one of TDS_SLP or TDS_SUSPENDED, depending upon which
constraint is lifted first.
This commit is contained in:
Julian Elischer 2002-08-23 20:13:22 +00:00
parent 7d151849d0
commit 7ed56cf283

View File

@ -307,7 +307,8 @@ struct thread {
TDS_SUSPENDED, /* would have liked to have run */
TDS_IWAIT,
TDS_SURPLUS,
TDS_SWAPPED
TDS_SWAPPED,
TDS_SUSP_SLP /* on sleep queue AND suspend queue */
} td_state;
struct callout td_slpcallout; /* (h) Callout for sleep. */
struct trapframe *td_frame; /* (k) */