[ 
https://issues.apache.org/jira/browse/QPID-8530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17356713#comment-17356713
 ] 

ASF GitHub Bot commented on QPID-8530:
--------------------------------------

mklaca opened a new pull request #90:
URL: https://github.com/apache/qpid-broker-j/pull/90


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


> [Broker-J] Duplicated functionality of the Selector::wakeup method in 
> SelectorThread
> ------------------------------------------------------------------------------------
>
>                 Key: QPID-8530
>                 URL: https://issues.apache.org/jira/browse/QPID-8530
>             Project: Qpid
>          Issue Type: Improvement
>          Components: Broker-J
>            Reporter: Marek Laca
>            Priority: Minor
>              Labels: Broker, Java, Thread, selector
>
> It is stated in Java documentation of the 
> [Selector::wakeup|https://docs.oracle.com/javase/7/docs/api/java/nio/channels/Selector.html#wakeup()]
>  method that:
> {code:none}
> 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. 
> {code}
> 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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to