Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3032)

Unified Diff: runtime/vm/os_thread.h

Issue 1557033002: Fixes for OSThread creation shutdown race. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address comments Created 4 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/dart.cc ('k') | runtime/vm/os_thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « runtime/vm/dart.cc ('k') | runtime/vm/os_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698