Package org.jgroups.protocols
Class SCOPE.QueueThread
java.lang.Object
org.jgroups.protocols.SCOPE.QueueThread
- All Implemented Interfaces:
Runnable
- Enclosing class:
SCOPE
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidrun()Try to remove as many messages as possible from the queue and pass them up.
-
Field Details
-
queue
-
first
protected boolean first
-
-
Constructor Details
-
QueueThread
-
-
Method Details
-
run
public void run()Try to remove as many messages as possible from the queue and pass them up. The outer and inner loop and the size() check at the end prevent the following scenario:- Threads T1 and T2 - T1 has the CAS - T1: remove() == null - T2: add() - T2: attempt to set the CAS: false, return - T1: set the CAS to false, return ==> Result: we have a message in the queue that nobody takes care of !
-