The module Thread supports handling of thread priorities and scheduling. More details on threads may be obtained in the Kernel specification The Definition of Kernel Oz [11] , or in Programming in Oz [3] .
highInt middleInt lowInt default background
Variables constrained to the positive integers representing thread priorities; these values satisfy: background \< default \< lowInt \< middleInt \< highInt. The particular choice of the integer values is implementation dependent: In the DFKI Oz System, Thread.background=0 and Thread.highInt=100 hold.
{`GetThreadPriority` ?I} Thread.getPriority = `GetThreadPriority`
Returns the priority I of the current thread, where I satisfies 0 < I < 100.
{`SetThreadPriority` +I} Thread.setPriority = `SetThreadPriority`
Sets the priority of the current thread to I, where I satisfies 0 < I < 100.
{setHighIntPri} {setMiddleIntPri} {setLowIntPri} {setDefaultPri} {setBackgroundPri}
Sets the priority of the current thread (in which the application is elaborated) to Thread.lowInt, middleInt, highInt, default, or background, respectively.
{preempt}
Preempts the current thread: On elaboration of {Thread.preempt}, a worker must put the current thread back into the queue.
{interrupt +ContP +RaiseB}
ContP is a continuation (a nullary procedure), which is called when RaiseB is bound to True. The elaboration of ContP is performed in a thread of middle interrupt priority.
{continue +ContP +Pri +RaiseB}
ContP is a continuation (a nullary procedure), which is called when RaiseB is bound to True. The elaboration of ContP is performed in a thread of priority Pri.