| Index: runtime/vm/os_thread.h
|
| diff --git a/runtime/vm/os_thread.h b/runtime/vm/os_thread.h
|
| index 2b825b8a6952d41abda3f509e39c243d7c99279f..84f11b6a7004faa7624ba9e93e27a9aea77e8c16 100644
|
| --- a/runtime/vm/os_thread.h
|
| +++ b/runtime/vm/os_thread.h
|
| @@ -228,8 +228,13 @@ class OSThread : public BaseThread {
|
| uword stack_base_;
|
| Thread* thread_;
|
|
|
| - static OSThread* thread_list_head_;
|
| + // thread_list_lock_ cannot have a static lifetime because the order in which
|
| + // destructors run is undefined. At the moment this lock cannot be deleted
|
| + // either since otherwise, if a thread only begins to run after we have
|
| + // started to run TLS destructors for a call to exit(), there will be a race
|
| + // on its deletion in CreateOSThread().
|
| static Mutex* thread_list_lock_;
|
| + static OSThread* thread_list_head_;
|
| static bool creation_enabled_;
|
|
|
| friend class OSThreadIterator;
|
|
|