It is stated in Java documentation of the Selector::wakeup method that:
Causes the first selection operation that has not yet returned to return immediately.
If another thread is currently blocked in an invocation of the select() or select(long) methods then that invocation will return immediately. If no selection operation is currently in progress then the next invocation of one of these methods will return immediately unless the selectNow() method is invoked in the meantime. In any case the value returned by that invocation may be non-zero. Subsequent invocations of the select() or select(long) methods will block as usual unless this method is invoked again in the meantime.
Invoking this method more than once between two successive selection operations has the same effect as invoking it just once.
SelectorThread.SelectionTask inner class in Java broker duplicates build in functionality of the Selector::wakeup method, what complicates the implementation. If the class attributes '_inSelect' and '_wakeups' were removed then the code of SelectorThread.SelectionTask class would be simplified. The wakeup method could be directly executed, there is no need for another checks.