Mercurial > hg > vamp-build-and-test
comparison DEPENDENCIES/generic/include/boost/thread/latch.hpp @ 101:c530137014c0
Update Boost headers (1.58.0)
author | Chris Cannam |
---|---|
date | Mon, 07 Sep 2015 11:12:49 +0100 |
parents | 2665513ce2d3 |
children |
comparison
equal
deleted
inserted
replaced
100:793467b5e61c | 101:c530137014c0 |
---|---|
25 { | 25 { |
26 /// @Requires: count_ must be greater than 0 | 26 /// @Requires: count_ must be greater than 0 |
27 /// Effect: Decrement the count. Unlocks the lock and notify anyone waiting if we reached zero. | 27 /// Effect: Decrement the count. Unlocks the lock and notify anyone waiting if we reached zero. |
28 /// Returns: true if count_ reached the value 0. | 28 /// Returns: true if count_ reached the value 0. |
29 /// @ThreadSafe ensured by the @c lk parameter | 29 /// @ThreadSafe ensured by the @c lk parameter |
30 bool count_down(unique_lock<mutex> &lk) | 30 bool count_down(unique_lock<mutex> &) |
31 /// pre_condition (count_ > 0) | 31 /// pre_condition (count_ > 0) |
32 { | 32 { |
33 BOOST_ASSERT(count_ > 0); | 33 BOOST_ASSERT(count_ > 0); |
34 if (--count_ == 0) | 34 if (--count_ == 0) |
35 { | 35 { |
36 ++generation_; | 36 ++generation_; |
37 lk.unlock(); | 37 //lk.unlock(); |
38 cond_.notify_all(); | 38 cond_.notify_all(); |
39 return true; | 39 return true; |
40 } | 40 } |
41 return false; | 41 return false; |
42 } | 42 } |