ProcSched.st
changeset 356 6c5ce0e1e7a8
parent 339 e8658d38abfb
child 357 82091a50055d
--- a/ProcSched.st	Fri May 19 15:33:11 1995 +0200
+++ b/ProcSched.st	Wed May 24 14:44:58 1995 +0200
@@ -34,7 +34,7 @@
 COPYRIGHT (c) 1993 by Claus Gittinger
 	     All Rights Reserved
 
-$Header: /cvs/stx/stx/libbasic/Attic/ProcSched.st,v 1.38 1995-05-08 03:30:32 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Attic/ProcSched.st,v 1.39 1995-05-24 12:43:46 claus Exp $
 '!
 
 Smalltalk at:#Processor put:nil!
@@ -57,7 +57,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libbasic/Attic/ProcSched.st,v 1.38 1995-05-08 03:30:32 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Attic/ProcSched.st,v 1.39 1995-05-24 12:43:46 claus Exp $
 "
 !
 
@@ -1417,7 +1417,8 @@
 !
 
 signal:aSemaphore atMilliseconds:aMillisecondTime
-    "arrange for a semaphore to be triggered at a specific millisecond time"
+    "arrange for a semaphore to be triggered at a specific millisecond time.
+     If there is already a pending trigger time, the time is changed."
 
     |index "{ Class: SmallInteger }"
      wasBlocked|
@@ -1440,6 +1441,7 @@
 	    timeoutProcessArray := timeoutProcessArray copyWith:nil 
 	].
     ].
+
     anyTimeouts := true.
     wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
 !
@@ -1626,12 +1628,16 @@
 addTimedBlock:aBlock for:aProcess atMilliseconds:aMillisecondTime
     "add the argument, aBlock to the list of time-scheduled-blocks; to be
      evaluated by aProcess when the millisecondClock value passes 
-     aMillisecondTime. The process specified by the argument,
-     aProcess will be interrupted for execution of the block. If
-     aProcess is nil, the block will be evaluated by the scheduler itself
+     aMillisecondTime. 
+     If that block is already in the timeout list, 
+     its trigger-time is changed.
+     The process specified by the argument, aProcess will be interrupted 
+     for execution of the block. 
+     If aProcess is nil, the block will be evaluated by the scheduler itself
      (which is dangerous - the block should not raise any error conditions).
-     (if it is running, the interrupt will occur in whatever method it is
-      executing; if it is suspended, it will be resumed).
+     If the process is active at trigger time, the interrupt will occur in 
+     whatever method it is executing; if suspended at trigger time, it will be 
+     resumed.
      The block will be removed from the timed-block list after evaluation 
      (i.e. it will trigger only once)."     
 
@@ -1656,6 +1662,7 @@
 	    timeoutProcessArray := timeoutProcessArray copyWith:aProcess.
 	].
     ].
+
     anyTimeouts := true.
     wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
 !