summaryrefslogtreecommitdiff
path: root/ace/WFMO_Reactor.cpp
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>2001-01-30 15:51:35 +0000
committerSteve Huston <shuston@riverace.com>2001-01-30 15:51:35 +0000
commit380ca4b0ad3d732b4ea4241846e84cf5c0cbd9f2 (patch)
tree2f3987f1ec021627866fba123ef78e74097c948e /ace/WFMO_Reactor.cpp
parent93f70af4abc416ffcfb4ab1d0a2d73eccdf78647 (diff)
downloadATCD-380ca4b0ad3d732b4ea4241846e84cf5c0cbd9f2.tar.gz
ChangeLogTag:Tue Jan 30 10:47:52 2001 Steve Huston <shuston@riverace.com>
Diffstat (limited to 'ace/WFMO_Reactor.cpp')
-rw-r--r--ace/WFMO_Reactor.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/ace/WFMO_Reactor.cpp b/ace/WFMO_Reactor.cpp
index 7b6a68c6acb..a8608a250ee 100644
--- a/ace/WFMO_Reactor.cpp
+++ b/ace/WFMO_Reactor.cpp
@@ -2312,8 +2312,10 @@ ACE_WFMO_Reactor_Notify::purge_pending_notifications (ACE_Event_Handler *eh)
{
ACE_TRACE ("ACE_WFMO_Reactor_Notify::purge_pending_notifications");
- // go over message queue and take out all the matching event handlers
- // if eh = 0, purge all..
+ // Go over message queue and take out all the matching event handlers.
+ // If eh == 0, purge all. Note that reactor notifies (no handler specified)
+ // are never purged, as this may lose a needed notify the reactor
+ // queued for itself.
if (this->message_queue_.is_empty ())
return 0;
@@ -2344,16 +2346,20 @@ ACE_WFMO_Reactor_Notify::purge_pending_notifications (ACE_Event_Handler *eh)
ACE_Notification_Buffer *buffer =
ACE_reinterpret_cast (ACE_Notification_Buffer *, mb->base ());
- if (eh && (eh != buffer->eh_))
- { // remove it by not copying it to the new queue
- if (-1 == local_queue.enqueue_head (mb))
- return -1;
- }
- else
+ // If this is not a Reactor notify (it is for a particular handler),
+ // and it matches the specified handler (or purging all), then
+ // release it and count the number purged.
+ if (0 != buffer->eh_ && (0 == eh || eh == buffer->eh_))
{
mb->release ();
++number_purged;
}
+ else
+ {
+ // To preserve it, move it to the local_queue.
+ if (-1 == local_queue.enqueue_head (mb))
+ return -1;
+ }
}
if (this->message_queue_.message_count ())