summaryrefslogtreecommitdiff
path: root/ACE/ace/Dev_Poll_Reactor.cpp
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>2010-03-19 16:47:33 +0000
committerSteve Huston <shuston@riverace.com>2010-03-19 16:47:33 +0000
commit3386dd16bd1d45e656039dedf3f81ca28d200d30 (patch)
tree5e56b9ee047781f445c040b4ff3c5116dde860dc /ACE/ace/Dev_Poll_Reactor.cpp
parent98d60b7ae7716cbe8e398418dd8371139cae80bf (diff)
downloadATCD-3386dd16bd1d45e656039dedf3f81ca28d200d30.tar.gz
ChangeLogTag:Fri Mar 19 16:44:37 UTC 2010 Steve Huston <shuston@riverace.com>
Diffstat (limited to 'ACE/ace/Dev_Poll_Reactor.cpp')
-rw-r--r--ACE/ace/Dev_Poll_Reactor.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/ACE/ace/Dev_Poll_Reactor.cpp b/ACE/ace/Dev_Poll_Reactor.cpp
index 035d6b17db0..70ff3451be4 100644
--- a/ACE/ace/Dev_Poll_Reactor.cpp
+++ b/ACE/ace/Dev_Poll_Reactor.cpp
@@ -134,11 +134,11 @@ ACE_Dev_Poll_Reactor_Notify::notify (ACE_Event_Handler *eh,
ACE_UNUSED_ARG (timeout);
ACE_Dev_Poll_Handler_Guard eh_guard (eh);
- // When using the queue, always try to write to the notify pipe. If it
- // fills up, ignore it safely because the already-written bytes will
- // eventually cause the notify handler to be dispatched.
- if (-1 == this->notification_queue_.push_new_notification (buffer))
- return -1; // Also decrement eh's reference count
+ // When using the queue, the push call indicates whether or not a pipe
+ // write is needed. If it's not, don't waste pipe space.
+ int push_result = this->notification_queue_.push_new_notification (buffer);
+ if (-1 == push_result || 1 == push_result)
+ return -1 == push_result ? -1 : 0; // Also decrement eh's reference count
// The notification has been queued, so it will be delivered at some
// point (and may have been already); release the refcnt guard.
@@ -2140,8 +2140,14 @@ ACE_Dev_Poll_Reactor::find_handler (ACE_HANDLE handle)
Event_Tuple *info = this->handler_rep_.find (handle);
if (info)
- info->event_handler->add_reference ();
- return info->event_handler;
+ {
+ info->event_handler->add_reference ();
+ return info->event_handler;
+ }
+ else
+ {
+ return 0;
+ }
}
int