From 0b7ec8532dc74dd526d1c70e40e524707a9a2f88 Mon Sep 17 00:00:00 2001 From: Steve Huston Date: Fri, 14 Feb 2014 16:46:09 +0000 Subject: ChangeLogTag:Fri Feb 14 16:34:46 UTC 2014 Steve Huston --- ACE/ChangeLog | 9 +++++++++ ACE/ace/Dev_Poll_Reactor.cpp | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/ACE/ChangeLog b/ACE/ChangeLog index ee9628c898d..dd9586090de 100644 --- a/ACE/ChangeLog +++ b/ACE/ChangeLog @@ -1,3 +1,12 @@ +Fri Feb 14 16:34:46 UTC 2014 Steve Huston + + * ace/Dev_Poll_Reactor.cpp (dispatch_io_event): Do not dispatch to + a handler that is suspended. Prevents multiple callbacks to the + same handler at the same time when multiple threads are dispatching + and changing registrations at the same time. Fixes Bugzilla 4129. + Thank you to Alexey Zubko and Howard Finer for both coming up with + the same answer independently! + Wed Feb 5 19:07:37 UTC 2014 Steve Huston * rpmbuild/ace-tao.spec: Added support for --without tao (and diff --git a/ACE/ace/Dev_Poll_Reactor.cpp b/ACE/ace/Dev_Poll_Reactor.cpp index ec0817a070b..81bc9091626 100644 --- a/ACE/ace/Dev_Poll_Reactor.cpp +++ b/ACE/ace/Dev_Poll_Reactor.cpp @@ -1176,6 +1176,12 @@ ACE_Dev_Poll_Reactor::dispatch_io_event (Token_Guard &guard) info = this->handler_rep_.find (handle); if (info == 0) // No registered handler any longer return 0; + // It is possible another thread has changed (and possibly re-armed) + // this handle mask before current thread obtained the repo lock. + // If that did happen and this handler is still suspended, don't + // dispatch on top of another callback. See Bugzilla 4129. + if (info->suspended) + return 0; // Figure out what to do first in order to make it easier to manage // the bit twiddling and possible pfds increment before releasing -- cgit v1.2.1