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

Unified Diff: runtime/vm/thread_registry.cc

Issue 1537543002: Fix for issue 25236 (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: code-review-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/thread.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/thread_registry.cc
diff --git a/runtime/vm/thread_registry.cc b/runtime/vm/thread_registry.cc
index 9a57793682d037ea006c2692888e7920d1dcd84d..5294521a3da4b5d283842fe600a670adddcc809e 100644
--- a/runtime/vm/thread_registry.cc
+++ b/runtime/vm/thread_registry.cc
@@ -76,28 +76,29 @@ Thread* ThreadRegistry::Schedule(Isolate* isolate,
}
Thread* thread = NULL;
OSThread* os_thread = OSThread::Current();
- ASSERT(os_thread != NULL);
- ASSERT(isolate->heap() != NULL);
- // First get a Thread structure. (we special case the mutator thread
- // by reusing the cached structure, see comment in 'thread_registry.h').
- if (is_mutator) {
- if (mutator_thread_ == NULL) {
- mutator_thread_ = GetThreadFromFreelist(isolate);
+ if (os_thread != NULL) {
+ ASSERT(isolate->heap() != NULL);
+ // First get a Thread structure. (we special case the mutator thread
+ // by reusing the cached structure, see comment in 'thread_registry.h').
+ if (is_mutator) {
+ if (mutator_thread_ == NULL) {
+ mutator_thread_ = GetThreadFromFreelist(isolate);
+ }
+ thread = mutator_thread_;
+ } else {
+ thread = GetThreadFromFreelist(isolate);
+ ASSERT(thread->api_top_scope() == NULL);
}
- thread = mutator_thread_;
- } else {
- thread = GetThreadFromFreelist(isolate);
- ASSERT(thread->api_top_scope() == NULL);
+ // Now add this Thread to the active list for the isolate.
+ AddThreadToActiveList(thread);
+ // Set up other values and set the TLS value.
+ thread->isolate_ = isolate;
+ thread->heap_ = isolate->heap();
+ thread->set_os_thread(os_thread);
+ os_thread->set_thread(thread);
+ Thread::SetCurrent(thread);
+ os_thread->EnableThreadInterrupts();
}
- // Now add this Thread to the active list for the isolate.
- AddThreadToActiveList(thread);
- // Set up other values and set the TLS value.
- thread->isolate_ = isolate;
- thread->heap_ = isolate->heap();
- thread->set_os_thread(os_thread);
- os_thread->set_thread(thread);
- Thread::SetCurrent(thread);
- os_thread->EnableThreadInterrupts();
return thread;
}
« no previous file with comments | « runtime/vm/thread.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698