| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- (* Release 3.10 *)
- (*-------------------------------------------------------------------------*
- * *
- * PASPROC.DEF - Modula-2 interface to PASPROC.ITF *
- * *
- * COPYRIGHT (C) 1989..1992 Clarion Software Corporation. *
- * All Rights Reserved *
- * *
- *--------------------------------------------------------------------------*)
- (*# project("#set tspas='on'") *)
- (*# call(o_a_copy => on,
- o_a_size => on,
- near_call=>off) *)
- (*# call(seg_name => PASPROC) *)
- (*# module(implementation=>off) *)
- DEFINITION MODULE PasProc;
- CONST
- MaxProcess = 32;
- TYPE SIGNAL;
- PROCEDURE StartScheduler;
- (* start the time sliced scheduler *)
- PROCEDURE StopScheduler;
- (* stops the time sliced scheduler *)
- PROCEDURE StartProcess(P: PROC; N: CARDINAL; Pr: CARDINAL);
- (* Start a new process *)
- PROCEDURE StopProcess();
- (* Stops current thread *)
- PROCEDURE SEND(s: SIGNAL);
- (* Send a signal *)
- PROCEDURE WAIT(s: SIGNAL);
- (* Wait for signal *)
- PROCEDURE Notify(s: SIGNAL);
- (*
- Causes a task waiting on signal s to be scheduled when possible,
- (e.g. at next time slice).
- If no-one is waiting on s then the call has NO effect.
- This call CANNOT cause reschedule, so may be used by an interrupt
- handler to safely notify another process of an events occurance.
- *)
- PROCEDURE Awaited(s: SIGNAL) : BOOLEAN;
- (* Returns if any process are waiting on signal *)
- PROCEDURE Init(VAR s: SIGNAL);
- (* Initialize a signal *)
- (*# save, call(c_conv=>on) *)
- PROCEDURE Delay(T: CARDINAL);
- (* delays for at least T timeslices *)
- (*# restore *)
- (*# save, call(reg_saved=>(ax,bx,cx,dx,di,si,ds,es,st1,st2)) *)
- PROCEDURE Lock;
- (*
- Critical region lock. Prevents the current process from
- being de-scheduled by timeslicing, until a call to Unlock.
- Calls to Lock may be nested.
- *)
- PROCEDURE Unlock;
- (*# restore *)
- (* Unlock procedure, always paired with a call to Lock. *)
- PROCEDURE Idler;
- END PasProc.
|