You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libcxx/test/std/thread/thread.threads/thread.thread.class
Billy Robert O'Neal III 22b685ebae 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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@344820 91177308-0d34-0410-b5e6-96231b3b80d8
6 years ago
..
thread.thread.algorithm Fix race conditions in test class used throughout the std::thread tests. 10 years ago
thread.thread.assign Clean up more usages of _LIBCPP_HAS_NO_RVALUE_REFERENCES 8 years ago
thread.thread.constr Repair thread-unsafe modifications of n_alive in F.pass.cpp 6 years ago
thread.thread.destr [libcxx] Add Atomic test helper and fix TSAN failures. 9 years ago
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 8 years ago
thread.thread.member Fix unused parameters and variables 8 years ago
thread.thread.static Move test into test/std subdirectory. 10 years ago