# HG changeset patch # User Jan Vrany # Date 1323785762 -3600 # Node ID 0090025b8aa709bd163096042682126fac685c7a # Parent 689bb92314557fa2f2c79383998cb60df7050aed Fix in #waitUntilProcessed diff -r 689bb9231455 -r 0090025b8aa7 BackgroundQueueProcessingJob.st --- 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