SharedQueue.st
changeset 2022 0f7f5bae8bdd
parent 1933 448db7605469
child 2032 05ebef21930b
--- a/SharedQueue.st	Wed Jul 09 14:51:55 2008 +0200
+++ b/SharedQueue.st	Wed Jul 09 22:56:31 2008 +0200
@@ -283,6 +283,18 @@
     "Modified: 16.12.1995 / 13:47:11 / cg"
 !
 
+readWaitWithTimeoutMs:ms
+    |avail|
+
+    dataAvailable wouldBlock ifFalse:[^ false].
+    avail := (dataAvailable waitWithTimeoutMs:ms) notNil.
+    avail ifTrue:[
+        "/ sigh - the above wait has already consumed the sema
+        dataAvailable signal
+    ].
+    ^ avail not
+!
+
 withAccessLockedDo:aBlock
     "evaluate aBlock while access via next/nextPut are blocked."
 
@@ -314,5 +326,5 @@
 !SharedQueue class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic2/SharedQueue.st,v 1.34 2008-03-08 10:56:09 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/SharedQueue.st,v 1.35 2008-07-09 20:56:31 cg Exp $'
 ! !