# HG changeset patch # User Claus Gittinger # Date 1453209306 -3600 # Node ID 473883f651d6d9d5d15c8ebd384fe9432fbcab68 # Parent f19ba96f772269afabbf853f4b86ea26a5335d47 #FEATURE class: BackgroundQueueProcessingJob comment/format in: #add:at: changed: #process it seems that nil might be a valid entry. diff -r f19ba96f7722 -r 473883f651d6 BackgroundQueueProcessingJob.st --- a/BackgroundQueueProcessingJob.st Mon Jan 18 20:19:57 2016 +0100 +++ b/BackgroundQueueProcessingJob.st Tue Jan 19 14:15:06 2016 +0100 @@ -140,8 +140,6 @@ ! add: object at: index - "includes: is not synchronized, but should not harm" - queueAccessLock critical:[ (queue includes: object) ifFalse:[ index notNil ifTrue:[ @@ -185,14 +183,18 @@ process [ - | item | + |hasMore item | - item := nil. + hasMore := false. queueAccessLock critical:[ - queue notEmpty ifTrue:[item := queue removeFirst] + queue notEmpty ifTrue:[ + hasMore := true. + item := queue removeFirst + ] ]. - item isNil ifTrue:[^ self]. + hasMore ifFalse:[^ self]. self processItem: item. + item := nil. ] loop. "Created: / 28-04-2011 / 20:36:35 / Jan Vrany "