From bedf2a66ce103b150c9b6725dd9a045f292dd9e7 Mon Sep 17 00:00:00 2001 From: schmidt Date: Mon, 20 Aug 2001 19:36:36 +0000 Subject: ChangeLogTag:Mon Aug 20 14:33:31 2001 Douglas C. Schmidt --- ChangeLog | 8 ++++++++ ChangeLogs/ChangeLog-02a | 8 ++++++++ ChangeLogs/ChangeLog-03a | 8 ++++++++ ace/Message_Queue_T.cpp | 10 ++++++++-- 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 58a87dfd61a..8751414ae73 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Mon Aug 20 14:33:31 2001 Douglas C. Schmidt + + * ace/Message_Queue_T.cpp: If we timeout in the semaphore implementation + of the message queue in wait_not_full_cond() or + wait_not_empty_cond() make sure to decrement the "waiters" count + accordingly! Thanks to Patrick Rabau + for noticing this in the C++NPv1 book version! + Mon Aug 20 07:01:31 2001 Douglas C. Schmidt * ace/Synch_T.i (release): If owner_ == -1 then return diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a index 58a87dfd61a..8751414ae73 100644 --- a/ChangeLogs/ChangeLog-02a +++ b/ChangeLogs/ChangeLog-02a @@ -1,3 +1,11 @@ +Mon Aug 20 14:33:31 2001 Douglas C. Schmidt + + * ace/Message_Queue_T.cpp: If we timeout in the semaphore implementation + of the message queue in wait_not_full_cond() or + wait_not_empty_cond() make sure to decrement the "waiters" count + accordingly! Thanks to Patrick Rabau + for noticing this in the C++NPv1 book version! + Mon Aug 20 07:01:31 2001 Douglas C. Schmidt * ace/Synch_T.i (release): If owner_ == -1 then return diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a index 58a87dfd61a..8751414ae73 100644 --- a/ChangeLogs/ChangeLog-03a +++ b/ChangeLogs/ChangeLog-03a @@ -1,3 +1,11 @@ +Mon Aug 20 14:33:31 2001 Douglas C. Schmidt + + * ace/Message_Queue_T.cpp: If we timeout in the semaphore implementation + of the message queue in wait_not_full_cond() or + wait_not_empty_cond() make sure to decrement the "waiters" count + accordingly! Thanks to Patrick Rabau + for noticing this in the C++NPv1 book version! + Mon Aug 20 07:01:31 2001 Douglas C. Schmidt * ace/Synch_T.i (release): If owner_ == -1 then return diff --git a/ace/Message_Queue_T.cpp b/ace/Message_Queue_T.cpp index 1dfba2d3ef2..306fee26771 100644 --- a/ace/Message_Queue_T.cpp +++ b/ace/Message_Queue_T.cpp @@ -715,7 +715,10 @@ ACE_Message_Queue::wait_not_full_cond (ACE_Guardnot_full_cond_.acquire (timeout); if (result == -1 && errno == ETIME) - errno = EWOULDBLOCK; + { + --this->enqueue_waiters_; + errno = EWOULDBLOCK; + } // Save/restore errno. ACE_Errno_Guard error (errno); @@ -760,7 +763,10 @@ ACE_Message_Queue::wait_not_empty_cond (ACE_Guardnot_empty_cond_.acquire (timeout); if (result == -1 && errno == ETIME) - errno = EWOULDBLOCK; + { + --this->dequeue_waiters_; + errno = EWOULDBLOCK; + } // Save/restore errno. ACE_Errno_Guard error (errno); -- cgit v1.2.1