hanchenye-llvm-project/libcxx/test/std/thread
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
..
futures [libcxx] Mark std::async race condition test as unsupported on Darwin 2018-10-09 14:57:40 +00:00
thread.condition Move POSIX specific test under test/libcxx subdirectory 2017-05-12 02:02:09 +00:00
thread.general
thread.mutex Change (void) casts to TEST_IGNORE_NODISCARD, as requested by Eric. Reviewed as https://reviews.llvm.org/D40065 2017-11-21 21:37:26 +00:00
thread.req
thread.threads Repair thread-unsafe modifications of n_alive in F.pass.cpp 2018-10-19 23:45:45 +00:00
macro.pass.cpp