Changes between Initial Version and Version 1 of Ticket #12620
- Timestamp:
- Dec 30, 2016, 1:39:04 AM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #12620
- Property Owner changed from to
-
Ticket #12620 – Description
initial v1 1 1 For a C++11 conformant g++ with working C++11 threads, the following code works if LIB is defined to std and throws if defined to boost:: 2 2 3 4 {{{ 3 5 #define LIB boost 4 6 … … 7 9 LIB::condition_variable cnd; 8 10 cnd.wait(l, []{ /*whatever*/ return true;}); // this throws. 11 12 }}} 9 13 10 14 The attached patch makes boost::unique_lock::unlock respect BOOST_THREAD_THROW_IF_PRECONDITION_NOT_SATISFIED and not require the lock to be held (if you'll ever have only one thread waiting on a condition variable it seems that the mutex is useless as there's no race involved, c++11 threads at least when backed by pthread seems to follow that behavior).