--- a/BackgroundQueueProcessingJob.st Tue Dec 06 19:03:05 2011 +0100
+++ b/BackgroundQueueProcessingJob.st Tue Dec 13 15:16:02 2011 +0100
@@ -198,10 +198,16 @@
waitUntilProcessed
"Blocks the receiver until all items from the queue are processed.
NOTE, that it may block forever if another thread is filling queue
- fadt enough."
+ fast enough."
- self scheduled ifFalse:[ ^ self ].
- queueProcessedSema wait.
+ | shouldWait |
+ queueAccessLock critical:[
+ shouldWait := queue isEmpty.
+ ].
+ shouldWait ifTrue:[
+ self start.
+ queueProcessedSema wait.
+ ]
"
queueProcessedSema signalForAll
@@ -213,11 +219,11 @@
!BackgroundQueueProcessingJob class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic2/BackgroundQueueProcessingJob.st,v 1.10 2011-12-06 18:03:05 vrany Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic2/BackgroundQueueProcessingJob.st,v 1.11 2011-12-13 14:16:02 vrany Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic2/BackgroundQueueProcessingJob.st,v 1.10 2011-12-06 18:03:05 vrany Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic2/BackgroundQueueProcessingJob.st,v 1.11 2011-12-13 14:16:02 vrany Exp $'
!
version_SVN