added: #stopAndRemoveAll
authorJan Vrany <jan.vrany@fit.cvut.cz>
Mon, 09 Apr 2012 19:00:41 +0200
changeset 2735 1960c3957377
parent 2734 38fd2b4e49ec
child 2736 5f916a59f5e6
added: #stopAndRemoveAll
BackgroundQueueProcessingJob.st
--- a/BackgroundQueueProcessingJob.st	Tue Apr 03 12:47:52 2012 +0200
+++ b/BackgroundQueueProcessingJob.st	Mon Apr 09 19:00:41 2012 +0200
@@ -203,6 +203,20 @@
     "Created: / 06-12-2011 / 16:01:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!BackgroundQueueProcessingJob methodsFor:'start & stop'!
+
+stopAndRemoveAll
+    "Terminates queue processing and remove all pending
+     items in a queue"
+
+    self stop.
+    queueAccessLock critical:[
+        queue := OrderedCollection new.
+    ]
+
+    "Created: / 09-04-2012 / 17:18:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !BackgroundQueueProcessingJob methodsFor:'utilities'!
 
 waitUntilProcessed
@@ -229,11 +243,11 @@
 !BackgroundQueueProcessingJob class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic2/BackgroundQueueProcessingJob.st,v 1.12 2012-01-20 17:27:22 vrany Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/BackgroundQueueProcessingJob.st,v 1.13 2012-04-09 17:00:41 vrany Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic2/BackgroundQueueProcessingJob.st,v 1.12 2012-01-20 17:27:22 vrany Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/BackgroundQueueProcessingJob.st,v 1.13 2012-04-09 17:00:41 vrany Exp $'
 !
 
 version_SVN