--- a/OperationQueue.st Thu Dec 07 15:33:43 2000 +0100
+++ b/OperationQueue.st Fri Dec 08 11:24:00 2000 +0100
@@ -168,6 +168,16 @@
return the result of the #value send.
If a similar order is already in the queue, wait for that one to finish."
+ ^ self scheduleOperation:anotherOperation asynchronous:false
+!
+
+scheduleOperation:anotherOperation asynchronous:asynchronous
+ "enqueue an order (something that understands #value) to the op-queue;
+ if asynchronous is false, wait until the operation has performed (#value been sent),
+ return the result of the #value send.
+ If a similar order is already in the queue, wait for that one to finish.
+ If asynchronous is true, do not wait (but also: do not return a return value)"
+
|myOpInQ|
queueLock critical:[
@@ -195,6 +205,10 @@
].
].
+ asynchronous ifTrue:[
+ ^ nil
+ ].
+
"/ wait for the operation to finish
myOpInQ operationPerformedSema wait.
@@ -251,5 +265,5 @@
!OperationQueue class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic2/OperationQueue.st,v 1.2 2000-12-01 17:12:44 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic2/OperationQueue.st,v 1.3 2000-12-08 10:24:00 martin Exp $'
! !