Commit 715ca752 authored by Martin Storsjö's avatar Martin Storsjö
Browse files

[libcxx] [test] Fix spurious failures in the thread detach test on Windows

Make sure that the detached thread has started up before exiting
the process.

If the detached thread hasn't started up at all, and the main thread
exits, global data structures in the process are torn down, which
then can cause crashes when the thread starts up late after required
mutexes have been destroyed. (In particular, the mutex used internally
in _Init_thread_header, which is used in the initialization of
__thread_local_data()::__p, can cause crashes if the main thread already
has finished and progressed far with destruction.)

Differential Revision: https://reviews.llvm.org/D105592
parent abfa950d
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment