--- a/SharedQueue.st Tue Dec 14 18:10:10 2004 +0100
+++ b/SharedQueue.st Tue Dec 14 18:11:28 2004 +0100
@@ -114,12 +114,12 @@
do:anObject
"evaluate the argument, aBlock for each element in the queue"
- |val|
+ |retVal|
accessLock critical:[
- val := super do:anObject.
+ retVal := super do:anObject.
].
- ^ val.
+ ^ retVal.
!
next
@@ -128,15 +128,15 @@
When the datum has been removed, signal space-availability to
writers"
- |value|
+ |retVal|
dataAvailable wait.
accessLock critical:[
- value := super next.
+ retVal := super next.
].
spaceAvailable signal.
- ^ value.
+ ^ retVal.
!
nextIfEmpty:exceptionValue
@@ -144,19 +144,19 @@
the value of exceptionValue.
When a datum has been removed, signal space-availability to writers"
- |value anyRemoved|
+ |retVal anyRemoved|
accessLock critical:[
self isEmpty ifTrue:[
- value := exceptionValue value
+ retVal := exceptionValue value
] ifFalse:[
- value := super next.
+ retVal := super next.
anyRemoved := true.
]
].
anyRemoved == true ifTrue:[spaceAvailable signal].
- ^ value.
+ ^ retVal.
!
nextPut:anObject
@@ -164,21 +164,25 @@
the queue is full. After the put, signal availablity of a datum
to readers."
+ |retVal|
+
spaceAvailable wait.
accessLock critical:[
- super nextPut:anObject.
+ retVal := super nextPut:anObject.
].
dataAvailable signal.
- ^ anObject.
+ ^ retVal.
!
nextPutFirst:anObject
+ |retVal|
+
spaceAvailable wait.
accessLock critical:[
- super nextPutFirst:anObject.
+ retVal := super nextPutFirst:anObject.
].
dataAvailable signal.
- ^ anObject.
+ ^ retVal.
!
removeAll
@@ -201,17 +205,17 @@
!
removeIdentical:anElement ifAbsent:exceptionalValue
- |value noSuchElement|
+ |retVal noSuchElement|
noSuchElement := false.
accessLock critical:[
- value := super removeIdentical:anElement ifAbsent:[noSuchElement := true]
+ retVal := super removeIdentical:anElement ifAbsent:[noSuchElement := true]
].
noSuchElement ifTrue:[
^ exceptionalValue value.
].
spaceAvailable signal.
- ^ value.
+ ^ retVal.
!
removeLast
@@ -220,15 +224,15 @@
When the datum has been removed, signal space-availability to
writers"
- |value|
+ |retVal|
dataAvailable wait.
accessLock critical:[
- value := super removeLast.
+ retVal := super removeLast.
].
spaceAvailable signal.
- ^ value.
+ ^ retVal.
! !
!SharedQueue methodsFor:'accessing-internals'!
@@ -279,5 +283,5 @@
!SharedQueue class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic2/SharedQueue.st,v 1.30 2004-12-14 17:10:10 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic2/SharedQueue.st,v 1.31 2004-12-14 17:11:28 cg Exp $'
! !