From 32364db4695aca003a7aa2ca41a72afe0c0796d3 Mon Sep 17 00:00:00 2001 From: schmidt Date: Tue, 3 Jul 2001 15:33:48 +0000 Subject: ChangeLogTag:Tue Jul 3 06:20:13 2001 Douglas C. Schmidt --- ace/WFMO_Reactor.cpp | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) (limited to 'ace/WFMO_Reactor.cpp') 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 -- cgit v1.2.1