415062 SelectorManager wakeup optimisation
Some further cleanup after sbordet review
This commit is contained in:
parent
70e7a69d19
commit
b58c05d77c
|
@ -366,12 +366,11 @@ public abstract class SelectorManager extends AbstractLifeCycle implements Dumpa
|
|||
if (_thread==Thread.currentThread())
|
||||
{
|
||||
// If we are already iterating over the changes, just add this change to the list.
|
||||
// No race here because it is this thread that is iterating over the changes.
|
||||
if (_state.compareAndSet(SelectorState.CHANGING,SelectorState.MORE_CHANGES))
|
||||
if (_state.get()==SelectorState.CHANGING)
|
||||
_changes.offer(change);
|
||||
else
|
||||
{
|
||||
// Otherwise we run the queued changes
|
||||
// Otherwise we run the queued changes, list should mostly be empty
|
||||
runChanges();
|
||||
// and then directly run the passed change
|
||||
runChange(change);
|
||||
|
|
Loading…
Reference in New Issue