summaryrefslogtreecommitdiff
path: root/ACE/ace
diff options
context:
space:
mode:
authorJustin Wilson <wilsonj@ociweb.com>2015-03-03 12:50:28 -0600
committerAdam Mitz <mitza@ociweb.com>2015-03-03 12:50:28 -0600
commit0d7e78fb7cf414a1dafced813cd38e5336047165 (patch)
tree37ff1a0351c3309c23a6da1c80b9b9ba28546dee /ACE/ace
parent7daf237b6c24099d39ca95495aca26a10dc31569 (diff)
downloadATCD-0d7e78fb7cf414a1dafced813cd38e5336047165.tar.gz
Fix to resume and register event handlers after returning -1 from
handle_*. Dev_Poll_Reactor on Linux uses epoll with one-shot and suspends handlers when an event is received. New logic attempts to resume handler when -1 is returned. Added test. From OCITAO 2.2a Fri Nov 14 16:47:56 UTC 2014
Diffstat (limited to 'ACE/ace')
-rw-r--r--ACE/ace/Dev_Poll_Reactor.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/ACE/ace/Dev_Poll_Reactor.cpp b/ACE/ace/Dev_Poll_Reactor.cpp
index 9bf45ceb24e..c8ca2f96e3a 100644
--- a/ACE/ace/Dev_Poll_Reactor.cpp
+++ b/ACE/ace/Dev_Poll_Reactor.cpp
@@ -1320,7 +1320,22 @@ ACE_Dev_Poll_Reactor::dispatch_io_event (Token_Guard &guard)
if (info != 0 && info->event_handler == eh)
{
if (status < 0)
- this->remove_handler_i (handle, disp_mask, grd);
+ {
+ this->remove_handler_i (handle, disp_mask, grd);
+#ifdef ACE_HAS_EVENT_POLL
+ // epoll-based effectively suspends handlers around the upcall.
+ // If the handler must be resumed, check to be sure it's the
+ // same handle/handler combination still.
+ if (reactor_resumes_eh)
+ {
+ info = this->handler_rep_.find (handle);
+ if (info != 0 && info->event_handler == eh)
+ {
+ this->resume_handler_i (handle);
+ }
+ }
+#endif /* ACE_HAS_EVENT_POLL */
+ }
}
}
// Scope close handles eh ref count decrement, if needed.