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

Unified Diff: runtime/vm/os_thread.cc

Issue 1555643002: Thread fixes for shutdown. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address comments Created 5 years 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/thread_pool.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/os_thread.cc
diff --git a/runtime/vm/os_thread.cc b/runtime/vm/os_thread.cc
index 766bbbed97d9f46800e24be459df8d8e0f2b6fe0..f6a7498280a6a2545b49266a08391066d99aced8 100644
--- a/runtime/vm/os_thread.cc
+++ b/runtime/vm/os_thread.cc
@@ -36,14 +36,18 @@ OSThread::OSThread() :
OSThread* OSThread::CreateOSThread() {
- ASSERT(thread_list_lock_ != NULL);
- MutexLocker ml(thread_list_lock_);
- if (!creation_enabled_) {
+ if (thread_list_lock_ == NULL) {
return NULL;
}
- OSThread* os_thread = new OSThread();
- AddThreadToListLocked(os_thread);
- return os_thread;
+ {
+ MutexLocker ml(thread_list_lock_);
Vyacheslav Egorov (Google) 2016/01/02 16:41:30 Code like this is a red-flag in multithreaded envi
zra 2016/01/04 17:19:10 Acknowledged.
+ if (!creation_enabled_) {
+ return NULL;
+ }
+ OSThread* os_thread = new OSThread();
+ AddThreadToListLocked(os_thread);
+ return os_thread;
+ }
}
« no previous file with comments | « runtime/vm/dart.cc ('k') | runtime/vm/thread_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698