Revert "415062 SelectorManager wakeup optimisation"

This reverts commit b58c05d77c.
This commit is contained in:
Joakim Erdfelt 2013-08-16 14:38:02 -07:00
parent 26faa5f0d7
commit d351c82de8
1 changed files with 3 additions and 2 deletions

View File

@ -366,11 +366,12 @@ 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.
if (_state.get()==SelectorState.CHANGING)
// No race here because it is this thread that is iterating over the changes.
if (_state.compareAndSet(SelectorState.CHANGING,SelectorState.MORE_CHANGES))
_changes.offer(change);
else
{
// Otherwise we run the queued changes, list should mostly be empty
// Otherwise we run the queued changes
runChanges();
// and then directly run the passed change
runChange(change);