#FEATURE
authorStefan Vogel <sv@exept.de>
Fri, 12 Feb 2016 23:13:33 +0100
changeset 19192 62dba7ef04eb
parent 19191 d7c92ebd54bf
child 19193 27e9b8923aa7
#FEATURE class: Semaphore changed: #waitWithTimeout: accept TimeDuration
Semaphore.st
--- a/Semaphore.st	Fri Feb 12 19:17:11 2016 +0100
+++ b/Semaphore.st	Fri Feb 12 23:13:33 2016 +0100
@@ -983,7 +983,7 @@
     "Modified: / 11-08-2011 / 14:37:00 / cg"
 !
 
-waitWithTimeout:secondsOrNil
+waitWithTimeout:secondsOrNilOrTimeDuration
     "wait for the semaphore, but abort the wait after some time (seconds).
      return the receiver if the semaphore triggered normal, nil if we return
      due to a timeout.
@@ -995,8 +995,8 @@
 
     |millis|
 
-    secondsOrNil notNil ifTrue:[
-        millis := secondsOrNil * 1000
+    secondsOrNilOrTimeDuration notNil ifTrue:[
+        millis := secondsOrNilOrTimeDuration asFloat * 1000
     ].
     ^ self waitWithTimeoutMs:millis.
 !