llvm-project/libcxx/test/std/thread/thread.threads/thread.thread.class
Billy Robert O'Neal III e04704b9a9 Repair thread-unsafe modifications of n_alive in F.pass.cpp
In this example, the ctor of G runs in the main thread in the expression G(), and also in the copy ctor of G() in the DECAY_COPY inside std::thread. The main thread destroys the G() instance at the semicolon, and the started thread destroys the G() after it returns. Thus there is a race between the threads on the n_alive variable.

The fix is to join with the background thread before attempting to destroy the G in the main thread.

llvm-svn: 344820
2018-10-19 23:45:45 +00:00
..
thread.thread.algorithm
thread.thread.assign Clean up more usages of _LIBCPP_HAS_NO_RVALUE_REFERENCES 2017-03-03 03:43:25 +00:00
thread.thread.constr Repair thread-unsafe modifications of n_alive in F.pass.cpp 2018-10-19 23:45:45 +00:00
thread.thread.destr
thread.thread.id Implement P0599: 'noexcept for hash functions'. Fix a couple of hash functions (optional<T> and unique_ptr<T>) which were mistakenly marked as 'noexcept'. Reviewed as https://reviews.llvm.org/D31234 2017-03-23 02:40:28 +00:00
thread.thread.member Fix unused parameters and variables 2016-12-23 23:37:52 +00:00
thread.thread.static