Changes between Initial Version and Version 1 of Ticket #12620


Ignore:
Timestamp:
Dec 30, 2016, 1:39:04 AM (6 years ago)
Author:
viboes
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #12620

    • Property Owner changed from Anthony Williams to viboes
  • Ticket #12620 – Description

    initial v1  
    11For 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::
    22
     3
     4{{{
    35#define LIB boost
    46
     
    79LIB::condition_variable cnd;
    810cnd.wait(l, []{ /*whatever*/ return true;}); // this throws.
     11
     12}}}
    913
    1014The 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).