gemmellr commented on a change in pull request #44:
URL: https://github.com/apache/qpid-jms/pull/44#discussion_r737507853
##########
File path: qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsSession.java
##########
@@ -194,6 +193,42 @@ public void onPendingFailure(ProviderException cause) {
}
}
+ private void processCompletions() {
+ do {
+ if (!completionThread.compareAndSet(null, Thread.currentThread()))
{
+ return;
+ }
+ try {
+ Runnable completionTask;
+ while ((completionTask = completionTasks.poll()) != null) {
+ try {
+ completionTask.run();
+ } catch (Throwable t) {
+ LOG.debug("errored on processCompletions duty cycle",
t);
+ }
+ }
+ } finally {
+ completionThread.set(null);
+ }
+ } while (!completionTasks.isEmpty());
Review comment:
So to be clear, the "one thread!" API doc is overstated, its happy with
isEmpty() concurrent with itself and with polls, so long as the poll is done
with one thread at a time?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]