Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/VDM/VDMPP/MSAWconcurPP/     Datei vom 13.4.2020 mit Größe 617 B image not shown  

SSL BaseThread.vdmpp   Sprache: VDM

 

class BaseThread
 
instance variables

protected period : nat1 := 1;
protected isPeriodic : bool := true;

operations

protected BaseThread : () ==> BaseThread
BaseThread() ==
 (World`timerRef.RegisterThread(self);
  if(not World`timerRef.IsInitialising())
  then start(self);  
 );

protected Step : () ==> ()
Step() ==
  is subclass responsibility

thread
 (if isPeriodic
  then (while true
        do 
         (Step();
          World`timerRef.WaitRelative(period);
         )
       )
  else (Step();
        World`timerRef.WaitRelative(0);
        World`timerRef.UnRegisterThread();
       )
 );

end BaseThread

Messung
CHZG
969510096

¤ Dauer der Verarbeitung: 0.26 Sekunden  ¤

*© Formatika GbR, Deutschland