Rolled back change f19ba96f7722 jv
authorJan Vrany <jan.vrany@fit.cvut.cz>
Tue, 19 Jan 2016 07:00:28 +0000
branchjv
changeset 3706 0db6c0586c81
parent 3705 fce41f02fc98
child 3716 be22b8b2f524
Rolled back change f19ba96f7722 A cookie object must be used because an item in the queue could be a nil!
BackgroundQueueProcessingJob.st
--- a/BackgroundQueueProcessingJob.st	Tue Jan 19 06:59:58 2016 +0100
+++ b/BackgroundQueueProcessingJob.st	Tue Jan 19 07:00:28 2016 +0000
@@ -184,16 +184,20 @@
 !BackgroundQueueProcessingJob methodsFor:'processing'!
 
 process
+
+    | cookie item |
+
+    cookie := 'cookie'.
     [
-        | item |
-
-        item := nil.
+        item := cookie.
         queueAccessLock critical:[
             queue notEmpty ifTrue:[item := queue removeFirst]
         ].
-        item isNil ifTrue:[^ self].
-        self processItem: item.
-    ] loop.
+        item ~~ cookie ifTrue:[
+            self processItem: item
+        ].
+        item ~~ cookie.
+    ] whileTrue.
 
     "Created: / 28-04-2011 / 20:36:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified (format): / 03-08-2011 / 16:43:21 / cg"
@@ -259,14 +263,14 @@
 !BackgroundQueueProcessingJob class methodsFor:'documentation'!
 
 version
-    ^ '$Header$'
+    ^ '$Header: /cvs/stx/stx/libbasic2/BackgroundQueueProcessingJob.st,v 1.17 2015-02-21 10:03:53 vrany Exp $'
 !
 
 version_CVS
-    ^ '$Header$'
+    ^ '$Header: /cvs/stx/stx/libbasic2/BackgroundQueueProcessingJob.st,v 1.17 2015-02-21 10:03:53 vrany Exp $'
 !
 
 version_SVN
-    ^ '$Id$'
+    ^ '$Id: BackgroundQueueProcessingJob.st,v 1.17 2015-02-21 10:03:53 vrany Exp $'
 ! !