Class SCOPE.QueueThread

java.lang.Object
org.jgroups.protocols.SCOPE.QueueThread
All Implemented Interfaces:
Runnable
Enclosing class:
SCOPE

protected class SCOPE.QueueThread extends Object implements Runnable
  • Field Details

  • Constructor Details

  • 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 !
       

      Specified by:
      run in interface Runnable