summaryrefslogtreecommitdiff
path: root/ACE/ace/TP_Reactor.cpp
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>2007-05-11 21:11:37 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>2007-05-11 21:11:37 +0000
commit966ecb7d8e5fa7e6a696efd06f27d27e46ead260 (patch)
treea411f2a08804b38289b5826fd2c62f62e0a55cd3 /ACE/ace/TP_Reactor.cpp
parentb4b0f42c10b5d9c9a276aa8c6c1d7816742e915b (diff)
downloadATCD-966ecb7d8e5fa7e6a696efd06f27d27e46ead260.tar.gz
ChangeLogTag:Fri May 11 21:49:01 UTC 2007 Ossama Othman <ossama_othman at symantec dot com>
Diffstat (limited to 'ACE/ace/TP_Reactor.cpp')
-rw-r--r--ACE/ace/TP_Reactor.cpp35
1 files changed, 24 insertions, 11 deletions
diff --git a/ACE/ace/TP_Reactor.cpp b/ACE/ace/TP_Reactor.cpp
index 5471a980b85..e6651f47da0 100644
--- a/ACE/ace/TP_Reactor.cpp
+++ b/ACE/ace/TP_Reactor.cpp
@@ -256,7 +256,7 @@ ACE_TP_Reactor::dispatch_i (ACE_Time_Value *max_wait_time,
this->state_changed_ = true;
}
- return 0;
+ return result;
}
@@ -619,17 +619,30 @@ ACE_TP_Reactor::post_process_socket_event (ACE_EH_Dispatch_Info &dispatch_info,
if (!guard.is_owner ())
return result;
- if (status < 0)
- {
- result =
- this->remove_handler_i (dispatch_info.handle_, dispatch_info.mask_);
+ // A different event handler may have been registered during the
+ // upcall if the handle was closed and then reopened, for
+ // example. Make sure we're removing and/or resuming the event
+ // handler used during the upcall.
+ ACE_Event_Handler const * const eh =
+ this->handler_rep_.find (dispatch_info.handle_);
+
+ // Only remove or resume the event handler used during the
+ // upcall.
+ if (eh == dispatch_info.event_handler_)
+ {
+ if (status < 0)
+ {
+ result =
+ this->remove_handler_i (dispatch_info.handle_,
+ dispatch_info.mask_);
+ }
+
+ // Resume handler if required.
+ if (dispatch_info.event_handler_ != this->notify_handler_ &&
+ dispatch_info.resume_flag_ ==
+ ACE_Event_Handler::ACE_REACTOR_RESUMES_HANDLER)
+ this->resume_i (dispatch_info.handle_);
}
-
- // Resume handler if required.
- if (dispatch_info.event_handler_ != this->notify_handler_ &&
- dispatch_info.resume_flag_ ==
- ACE_Event_Handler::ACE_REACTOR_RESUMES_HANDLER)
- this->resume_i (dispatch_info.handle_);
}
// Call remove_reference() if needed.