(*
    Title: 	Extra things to do with threads
    LastEdit:	"Mon Feb  1 17:16:13 1988"
    Author: 	Derek McAuley,Oms101,4652
		Cambridge University Computer Laboratory
*)

DEFINITION MODULE ThreadsExtra;


IMPORT
  Threads;


EXPORT QUALIFIED
  TopPriority, DefPriority, LastPriority,

  Priority, PProc,
  
  currentThread, currentPriority, preEmpt, thePProc,
  
  SetMyPriority, GetMyPriority, SetPriority, GetPriority;
  

CONST
  TopPriority  = 0;
  DefPriority  = 3;
  LastPriority = 6;


TYPE
  Priority = [TopPriority..LastPriority];
  PProc = PROCEDURE (Threads.Thread, VAR Priority, BOOLEAN);

VAR
  thePProc:PProc;

VAR
  preEmpt:BOOLEAN;
  currentThread:Threads.Thread;
  currentPriority:Priority;


PROCEDURE SetMyPriority(p:Priority);

PROCEDURE GetMyPriority():Priority;

PROCEDURE SetPriority(thread:Threads.Thread; p:Priority);

PROCEDURE GetPriority(thread:Threads.Thread):Priority;

END ThreadsExtra.
