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

Side by Side Diff: runtime/vm/isolate.cc

Issue 1756393002: Fix some service protocol isolate lifecycle races (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « runtime/observatory/lib/src/service/object.dart ('k') | runtime/vm/service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/isolate.h" 5 #include "vm/isolate.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "include/dart_native_api.h" 8 #include "include/dart_native_api.h"
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "platform/text_buffer.h" 10 #include "platform/text_buffer.h"
(...skipping 1932 matching lines...) Expand 10 before | Expand all | Expand 10 after
1943 JSONObject jsheap(&jsobj, "_heaps"); 1943 JSONObject jsheap(&jsobj, "_heaps");
1944 heap()->PrintToJSONObject(Heap::kNew, &jsheap); 1944 heap()->PrintToJSONObject(Heap::kNew, &jsheap);
1945 heap()->PrintToJSONObject(Heap::kOld, &jsheap); 1945 heap()->PrintToJSONObject(Heap::kOld, &jsheap);
1946 } 1946 }
1947 1947
1948 jsobj.AddProperty("runnable", is_runnable()); 1948 jsobj.AddProperty("runnable", is_runnable());
1949 jsobj.AddProperty("livePorts", message_handler()->live_ports()); 1949 jsobj.AddProperty("livePorts", message_handler()->live_ports());
1950 jsobj.AddProperty("pauseOnExit", message_handler()->should_pause_on_exit()); 1950 jsobj.AddProperty("pauseOnExit", message_handler()->should_pause_on_exit());
1951 1951
1952 if (debugger() != NULL) { 1952 if (debugger() != NULL) {
1953 if (message_handler()->is_paused_on_start()) { 1953 if (!is_runnable()) {
1954 // Isolate is not yet runnable.
1955 ASSERT(debugger()->PauseEvent() == NULL);
1956 ServiceEvent pause_event(this, ServiceEvent::kNone);
1957 jsobj.AddProperty("pauseEvent", &pause_event);
1958 } else if (message_handler()->is_paused_on_start() ||
1959 message_handler()->should_pause_on_start()) {
1954 ASSERT(debugger()->PauseEvent() == NULL); 1960 ASSERT(debugger()->PauseEvent() == NULL);
1955 ServiceEvent pause_event(this, ServiceEvent::kPauseStart); 1961 ServiceEvent pause_event(this, ServiceEvent::kPauseStart);
1956 jsobj.AddProperty("pauseEvent", &pause_event); 1962 jsobj.AddProperty("pauseEvent", &pause_event);
1957 } else if (message_handler()->is_paused_on_exit()) { 1963 } else if (message_handler()->is_paused_on_exit()) {
1958 ASSERT(debugger()->PauseEvent() == NULL); 1964 ASSERT(debugger()->PauseEvent() == NULL);
1959 ServiceEvent pause_event(this, ServiceEvent::kPauseExit); 1965 ServiceEvent pause_event(this, ServiceEvent::kPauseExit);
1960 jsobj.AddProperty("pauseEvent", &pause_event); 1966 jsobj.AddProperty("pauseEvent", &pause_event);
1961 } else if (debugger()->PauseEvent() != NULL && !resume_request_) { 1967 } else if (debugger()->PauseEvent() != NULL && !resume_request_) {
1962 ServiceEvent pause_event(debugger()->PauseEvent()); 1968 ServiceEvent pause_event(debugger()->PauseEvent());
1963 jsobj.AddProperty("pauseEvent", &pause_event); 1969 jsobj.AddProperty("pauseEvent", &pause_event);
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after
2832 void IsolateSpawnState::DecrementSpawnCount() { 2838 void IsolateSpawnState::DecrementSpawnCount() {
2833 ASSERT(spawn_count_monitor_ != NULL); 2839 ASSERT(spawn_count_monitor_ != NULL);
2834 ASSERT(spawn_count_ != NULL); 2840 ASSERT(spawn_count_ != NULL);
2835 MonitorLocker ml(spawn_count_monitor_); 2841 MonitorLocker ml(spawn_count_monitor_);
2836 ASSERT(*spawn_count_ > 0); 2842 ASSERT(*spawn_count_ > 0);
2837 *spawn_count_ = *spawn_count_ - 1; 2843 *spawn_count_ = *spawn_count_ - 1;
2838 ml.Notify(); 2844 ml.Notify();
2839 } 2845 }
2840 2846
2841 } // namespace dart 2847 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/observatory/lib/src/service/object.dart ('k') | runtime/vm/service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698