diff options
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-02a | 12 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-03a | 12 | ||||
-rw-r--r-- | ace/Message_Queue_T.cpp | 5 | ||||
-rw-r--r-- | ace/Message_Queue_T.h | 29 | ||||
-rw-r--r-- | ace/Message_Queue_T.i | 8 | ||||
-rw-r--r-- | examples/C++NPv2/AC_Client_Logging_Daemon.cpp | 2 |
7 files changed, 64 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog index 48a92cf2af8..51ad3870bbc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +Tue Jun 4 06:46:27 2002 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu> + + * examples/C++NPv2/AC_Client_Logging_Daemon.cpp: Added the + "1" parameter to the call to deactivate() method to simply + "pulse" the queue. + + * ace/Message_Queue_T.h: Added new pulse parameter to + ACE_Message_Queue::deactivate() so that callers can decide + whether to change the state of the queue to be "deactivated" or + just to pulse waiting threads to wake up and continue their + processing. This simplies one of the examples in C++NPv2. + Mon Jun 3 16:11:12 2002 Krishnakumar B <kitty@cs.wustl.edu> * ACEXML/common/FileCharStream.cpp: diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a index 48a92cf2af8..51ad3870bbc 100644 --- a/ChangeLogs/ChangeLog-02a +++ b/ChangeLogs/ChangeLog-02a @@ -1,3 +1,15 @@ +Tue Jun 4 06:46:27 2002 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu> + + * examples/C++NPv2/AC_Client_Logging_Daemon.cpp: Added the + "1" parameter to the call to deactivate() method to simply + "pulse" the queue. + + * ace/Message_Queue_T.h: Added new pulse parameter to + ACE_Message_Queue::deactivate() so that callers can decide + whether to change the state of the queue to be "deactivated" or + just to pulse waiting threads to wake up and continue their + processing. This simplies one of the examples in C++NPv2. + Mon Jun 3 16:11:12 2002 Krishnakumar B <kitty@cs.wustl.edu> * ACEXML/common/FileCharStream.cpp: diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a index 48a92cf2af8..51ad3870bbc 100644 --- a/ChangeLogs/ChangeLog-03a +++ b/ChangeLogs/ChangeLog-03a @@ -1,3 +1,15 @@ +Tue Jun 4 06:46:27 2002 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu> + + * examples/C++NPv2/AC_Client_Logging_Daemon.cpp: Added the + "1" parameter to the call to deactivate() method to simply + "pulse" the queue. + + * ace/Message_Queue_T.h: Added new pulse parameter to + ACE_Message_Queue::deactivate() so that callers can decide + whether to change the state of the queue to be "deactivated" or + just to pulse waiting threads to wake up and continue their + processing. This simplies one of the examples in C++NPv2. + Mon Jun 3 16:11:12 2002 Krishnakumar B <kitty@cs.wustl.edu> * ACEXML/common/FileCharStream.cpp: diff --git a/ace/Message_Queue_T.cpp b/ace/Message_Queue_T.cpp index 5e003faa494..8685ef37901 100644 --- a/ace/Message_Queue_T.cpp +++ b/ace/Message_Queue_T.cpp @@ -557,7 +557,7 @@ ACE_Message_Queue<ACE_SYNCH_USE>::open (size_t hwm, // (assumes locks are held). template <ACE_SYNCH_DECL> int -ACE_Message_Queue<ACE_SYNCH_USE>::deactivate_i (void) +ACE_Message_Queue<ACE_SYNCH_USE>::deactivate_i (int pulse) { ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::deactivate_i"); int current_status = @@ -569,7 +569,8 @@ ACE_Message_Queue<ACE_SYNCH_USE>::deactivate_i (void) this->not_full_cond_.broadcast (); #endif /* ACE_HAS_OPTIMIZED_MESSAGE_QUEUE */ - this->deactivated_ = 1; + if (pulse == 0) + this->deactivated_ = 1; return current_status; } diff --git a/ace/Message_Queue_T.h b/ace/Message_Queue_T.h index c9c9c0153bb..98dceb9a486 100644 --- a/ace/Message_Queue_T.h +++ b/ace/Message_Queue_T.h @@ -305,13 +305,15 @@ public: // = Activation control methods. /** - * Deactivate the queue and wakeup all threads waiting on the queue - * so they can continue. No messages are removed from the queue, - * however. Any other operations called until the queue is - * activated again will immediately return -1 with <errno> == - * ESHUTDOWN. Returns WAS_INACTIVE if queue was inactive before the - * call and WAS_ACTIVE if queue was active before the call. - */ + * Notifies all waiting threads that the queue has been deactivated + * so they can wakeup and continue other processing. If <pulse> is + * 0 then the queue's state is changed to deactivated and any other + * operations called until the queue is activated again will + * immediately return -1 with <errno> == ESHUTDOWN. If <pulse> is + * non-0 then only the waiting threads are notified and the queue's state + * is not changed. In either case, however, no messages are removed + * from the queue. Returns WAS_INACTIVE if queue was inactive before + * the call and WAS_ACTIVE if queue was active before the call. */ virtual int deactivate (void); /** @@ -404,8 +406,17 @@ protected: // These methods assume locks are held. - /// Deactivate the queue. - virtual int deactivate_i (void); + /** + * Notifies all waiting threads that the queue has been deactivated + * so they can wakeup and continue other processing. If <pulse> is + * 0 then the queue's state is changed to deactivated and any other + * operations called until the queue is activated again will + * immediately return -1 with <errno> == ESHUTDOWN. If <pulse> is + * non-0 then only the waiting threads are notified and the queue's state + * is not changed. In either case, however, no messages are removed + * from the queue. Returns WAS_INACTIVE if queue was inactive before + * the call and WAS_ACTIVE if queue was active before the call. */ + virtual int deactivate_i (int pulse); /// Activate the queue. virtual int activate_i (void); diff --git a/ace/Message_Queue_T.i b/ace/Message_Queue_T.i index 297cd12830e..3791a4d2c25 100644 --- a/ace/Message_Queue_T.i +++ b/ace/Message_Queue_T.i @@ -138,12 +138,12 @@ ACE_Message_Queue<ACE_SYNCH_USE>::activate (void) } template <ACE_SYNCH_DECL> ACE_INLINE int -ACE_Message_Queue<ACE_SYNCH_USE>::deactivate (void) +ACE_Message_Queue<ACE_SYNCH_USE>::deactivate (int pulse) { ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::deactivate"); ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1); - return this->deactivate_i (); + return this->deactivate_i (pulse); } template <ACE_SYNCH_DECL> ACE_INLINE int @@ -277,11 +277,11 @@ ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::activate (void) } template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> ACE_INLINE int -ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::deactivate (void) +ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::deactivate (int pulse) { ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::deactivate"); - return this->queue_.deactivate (); + return this->queue_.deactivate (pulse); } template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> ACE_INLINE int diff --git a/examples/C++NPv2/AC_Client_Logging_Daemon.cpp b/examples/C++NPv2/AC_Client_Logging_Daemon.cpp index d9c8c93119f..d1a0723e928 100644 --- a/examples/C++NPv2/AC_Client_Logging_Daemon.cpp +++ b/examples/C++NPv2/AC_Client_Logging_Daemon.cpp @@ -198,7 +198,7 @@ int AC_Output_Handler::handle_input (ACE_HANDLE h) { reactor ()->remove_handler (h, ACE_Event_Handler::READ_MASK | ACE_Event_Handler::DONT_CALL); - msg_queue ()->deactivate (); + msg_queue ()->deactivate (1); return 0; } |