protected class SCOPE.QueueThread
extends java.lang.Object
implements java.lang.Runnable
限定符和类型 | 字段和说明 |
---|---|
protected boolean |
first |
protected SCOPE.MessageQueue |
queue |
构造器和说明 |
---|
SCOPE.QueueThread(SCOPE.MessageQueue queue) |
限定符和类型 | 方法和说明 |
---|---|
void |
run()
Try to remove as many messages as possible from the queue and pass them up.
|
protected final SCOPE.MessageQueue queue
protected boolean first
public SCOPE.QueueThread(SCOPE.MessageQueue queue)
public void run()
- 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 !
run
在接口中 java.lang.Runnable