-------------------------------------------------------------------------

Copyright 2007 Richard J. Gaydos.

-------------------------------------------------------------------------

Modules: Block and Unblock a Task

-------------------------------------------------------------------------

Block a Task
 
-------------------------------------------------------------------------
 
Block_a_Task(PCB_Address)

Blocked = 1
 
-------------------------------------------------------------------------
 
The  Blocked  Field in Your  PCB is Given an Initial Value of Zero
This Indicates that the Task is  NOT  Waiting for Any I/O or
     Resource
 
The  OS  Program called the Traffic Controller will only choose to
     give the  CPU  to Tasks whose  Blocked = 0
 
Everyone's PCBs are linked together by the PCB   Next   Fields
Your  PCB points to someone else's PCB
Their PCB points to a third PCB
Etc ...
 
This gives the  OS  a Circular Linked List of PCB Addresses

Whenever Your Task is Suspended, the Current Contents of PSWR are
         Saved at  PSWR_Save
 
While Your Task  "Waits", Blocked is Set Equal to  One
  
The  Traffic Controller Will Not Let the  CPU  Run your Task again
     Until   Blocked becomes Zero

Your Task will Start to Run When the OS does
 
               LPSW  PSWR_Save  from your  PCB

-------------------------------------------------------------------------

Unblock a Task
 
-------------------------------------------------------------------------

Unblock_a_Task(PCB_Address)

Blocked = 0

-------------------------------------------------------------------------