forked from OSchip/llvm-project
![]() 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 |
||
---|---|---|
.. | ||
thread.thread.algorithm | ||
thread.thread.assign | ||
thread.thread.constr | ||
thread.thread.destr | ||
thread.thread.id | ||
thread.thread.member | ||
thread.thread.static |