Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#7 blocking_dequeue exit/enter monitor too often

open
nobody
None
5
2003-09-17
2003-09-17
Anonymous
No

For all 3 blocking_dequeue, I see the loop exits and
enters the monitor endlessly.
The synchronized statement should be outside the loop.

synchronized (blocker) { //moved here
while (true) {
//synchronized (blocker) { //HACK: do not
re-synchronize move out of loop

Discussion