Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r86546 - trunk/boost/sync/detail/condition_variables
From: andrey.semashev_at_[hidden]
Date: 2013-11-03 10:08:19


Author: andysem
Date: 2013-11-03 10:08:19 EST (Sun, 03 Nov 2013)
New Revision: 86546
URL: http://svn.boost.org/trac/boost/changeset/86546

Log:
Fixed notify functions behavior.

Text files modified:
   trunk/boost/sync/detail/condition_variables/basic_condition_variable_windows.hpp | 3 ++-
   1 files changed, 2 insertions(+), 1 deletions(-)

Modified: trunk/boost/sync/detail/condition_variables/basic_condition_variable_windows.hpp
==============================================================================
--- trunk/boost/sync/detail/condition_variables/basic_condition_variable_windows.hpp Sat Nov 2 08:58:03 2013 (r86545)
+++ trunk/boost/sync/detail/condition_variables/basic_condition_variable_windows.hpp 2013-11-03 10:08:19 EST (Sun, 03 Nov 2013) (r86546)
@@ -257,9 +257,10 @@
         {
             while (true)
             {
- const long n = m_notify_state->m_waiter_count - m_notify_state->m_notify_count;
+ long n = m_notify_state->m_waiter_count - m_notify_state->m_notify_count;
                 if (n > 0)
                 {
+ n = n > count_to_wake ? count_to_wake : n;
                     m_notify_state->m_notify_count += n;
                     boost::detail::winapi::ReleaseSemaphore(m_notify_state->m_semaphore, n, NULL);
                     count_to_wake -= n;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk