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

Unified Diff: runtime/lib/isolate.cc

Issue 1041523002: Refactor Thread lifecycle interface, add Thread::Enter/ExitIsolate. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 9 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/include/dart_api.h ('k') | runtime/vm/benchmark_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/isolate.cc
===================================================================
--- runtime/lib/isolate.cc (revision 44762)
+++ runtime/lib/isolate.cc (working copy)
@@ -168,7 +168,6 @@
Dart_IsolateCreateCallback callback = Isolate::CreateCallback();
if (callback == NULL) {
*error = strdup("Null callback specified for isolate creation\n");
- Isolate::SetCurrent(parent_isolate);
return false;
}
@@ -180,7 +179,6 @@
init_data,
error));
if (child_isolate == NULL) {
- Isolate::SetCurrent(parent_isolate);
return false;
}
if (!state->is_spawn_uri()) {
@@ -189,22 +187,22 @@
child_isolate->set_origin_id(parent_isolate->origin_id());
}
state->set_isolate(reinterpret_cast<Isolate*>(child_isolate));
-
- Isolate::SetCurrent(parent_isolate);
return true;
}
static void Spawn(Isolate* parent_isolate, IsolateSpawnState* state) {
+ Thread::ExitIsolate();
// Create a new isolate.
char* error = NULL;
if (!CreateIsolate(parent_isolate, state, &error)) {
+ Thread::EnterIsolate(parent_isolate);
delete state;
const String& msg = String::Handle(String::New(error));
free(error);
ThrowIsolateSpawnException(msg);
}
-
+ Thread::EnterIsolate(parent_isolate);
// Start the new isolate if it is already marked as runnable.
Isolate* spawned_isolate = state->isolate();
MutexLocker ml(spawned_isolate->mutex());
« no previous file with comments | « runtime/include/dart_api.h ('k') | runtime/vm/benchmark_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698