summaryrefslogtreecommitdiff
path: root/ace/WFMO_Reactor.cpp
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>2001-07-03 15:33:48 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>2001-07-03 15:33:48 +0000
commit32364db4695aca003a7aa2ca41a72afe0c0796d3 (patch)
tree4c6a5117fcd79fd58f1d7b090f01830af6362a6c /ace/WFMO_Reactor.cpp
parent5ef70d1ee4231e626ce1c06f4c5b48b24230260e (diff)
downloadATCD-32364db4695aca003a7aa2ca41a72afe0c0796d3.tar.gz
ChangeLogTag:Tue Jul 3 06:20:13 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu>
Diffstat (limited to 'ace/WFMO_Reactor.cpp')
-rw-r--r--ace/WFMO_Reactor.cpp41
1 files changed, 27 insertions, 14 deletions
diff --git a/ace/WFMO_Reactor.cpp b/ace/WFMO_Reactor.cpp
index a661b7733fa..7039cde14ed 100644
--- a/ace/WFMO_Reactor.cpp
+++ b/ace/WFMO_Reactor.cpp
@@ -2347,7 +2347,8 @@ ACE_WFMO_Reactor_Notify::max_notify_iterations (void)
}
int
-ACE_WFMO_Reactor_Notify::purge_pending_notifications (ACE_Event_Handler *eh)
+ACE_WFMO_Reactor_Notify::purge_pending_notifications (ACE_Event_Handler *eh,
+ ACE_Reactor_Mask mask)
{
ACE_TRACE ("ACE_WFMO_Reactor_Notify::purge_pending_notifications");
@@ -2386,19 +2387,30 @@ ACE_WFMO_Reactor_Notify::purge_pending_notifications (ACE_Event_Handler *eh)
ACE_reinterpret_cast (ACE_Notification_Buffer *, mb->base ());
// If this is not a Reactor notify (it is for a particular handler),
- // and it matches the specified handler (or purging all), then
+ // and it matches the specified handler (or purging all),
+ // and applying the mask would totally eliminate the notification, then
// release it and count the number purged.
- if (0 != buffer->eh_ && (0 == eh || eh == buffer->eh_))
- {
- mb->release ();
- ++number_purged;
- }
+ if ((0 != buffer->eh_) &&
+ (0 == eh || eh == buffer->eh_) &&
+ ACE_BIT_DISABLED (buffer->mask_, ~mask)) // the existing notification mask
+ // is left with nothing when
+ // applying the mask
+ {
+ mb->release ();
+ ++number_purged;
+ }
else
- {
- // To preserve it, move it to the local_queue.
- if (-1 == local_queue.enqueue_head (mb))
- return -1;
- }
+ {
+ // To preserve it, move it to the local_queue.
+ // But first, if this is not a Reactor notify (it is for a particularhandler),
+ // and it matches the specified handler (or purging all), then
+ // apply the mask
+ if ((0 != buffer->eh_) &&
+ (0 == eh || eh == buffer->eh_))
+ ACE_CLR_BITS(buffer->mask_, mask);
+ if (-1 == local_queue.enqueue_head (mb))
+ return -1;
+ }
}
if (this->message_queue_.message_count ())
@@ -2461,10 +2473,11 @@ ACE_WFMO_Reactor::max_notify_iterations (void)
}
int
-ACE_WFMO_Reactor::purge_pending_notifications (ACE_Event_Handler *eh)
+ACE_WFMO_Reactor::purge_pending_notifications (ACE_Event_Handler *eh,
+ ACE_Reactor_Mask mask)
{
ACE_TRACE ("ACE_WFMO_Reactor::purge_pending_notifications");
- return this->notify_handler_->purge_pending_notifications (eh);
+ return this->notify_handler_->purge_pending_notifications (eh, mask);
}
// No-op WinSOCK2 methods to help WFMO_Reactor compile