summaryrefslogtreecommitdiff
path: root/ACE/ace/Dev_Poll_Reactor.cpp
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>2014-02-14 16:40:08 +0000
committerSteve Huston <shuston@riverace.com>2014-02-14 16:40:08 +0000
commit087791db08effe5b10a4bc011caa6fce5f86069d (patch)
tree5bf50942c40d6543f457ae6b580abded56d31814 /ACE/ace/Dev_Poll_Reactor.cpp
parente748831e69c06dd6517c1cf8ee70b422b07dc861 (diff)
downloadATCD-087791db08effe5b10a4bc011caa6fce5f86069d.tar.gz
Fri Feb 14 16:34:46 UTC 2014 Steve Huston <shuston@riverace.com>
* 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! * THANKS: Added Alexey Zubo to the Hall of Fame.
Diffstat (limited to 'ACE/ace/Dev_Poll_Reactor.cpp')
-rw-r--r--ACE/ace/Dev_Poll_Reactor.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/ACE/ace/Dev_Poll_Reactor.cpp b/ACE/ace/Dev_Poll_Reactor.cpp
index adc72f23c1f..739bffd52b3 100644
--- a/ACE/ace/Dev_Poll_Reactor.cpp
+++ b/ACE/ace/Dev_Poll_Reactor.cpp
@@ -1177,6 +1177,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