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

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

Issue 1350713004: Disable shutdown (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: check shutdown flag in service isolate Created 5 years, 3 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/vm/dart.cc ('k') | no next file » | 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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/service_isolate.h" 5 #include "vm/service_isolate.h"
6 6
7 #include "vm/compiler.h" 7 #include "vm/compiler.h"
8 #include "vm/dart_api_impl.h" 8 #include "vm/dart_api_impl.h"
9 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
11 #include "vm/lockers.h" 11 #include "vm/lockers.h"
12 #include "vm/message.h" 12 #include "vm/message.h"
13 #include "vm/message_handler.h" 13 #include "vm/message_handler.h"
14 #include "vm/native_entry.h" 14 #include "vm/native_entry.h"
15 #include "vm/native_arguments.h" 15 #include "vm/native_arguments.h"
16 #include "vm/object.h" 16 #include "vm/object.h"
17 #include "vm/object_store.h" 17 #include "vm/object_store.h"
18 #include "vm/port.h" 18 #include "vm/port.h"
19 #include "vm/service.h" 19 #include "vm/service.h"
20 #include "vm/symbols.h" 20 #include "vm/symbols.h"
21 #include "vm/thread_pool.h" 21 #include "vm/thread_pool.h"
22 22
23 namespace dart { 23 namespace dart {
24 24
25 DECLARE_FLAG(bool, shutdown);
26
25 #define Z (T->zone()) 27 #define Z (T->zone())
26 28
27 29
28 DEFINE_FLAG(bool, trace_service, false, "Trace VM service requests."); 30 DEFINE_FLAG(bool, trace_service, false, "Trace VM service requests.");
29 DEFINE_FLAG(bool, trace_service_pause_events, false, 31 DEFINE_FLAG(bool, trace_service_pause_events, false,
30 "Trace VM service isolate pause events."); 32 "Trace VM service isolate pause events.");
31 33
32 struct ResourcesEntry { 34 struct ResourcesEntry {
33 const char* path_; 35 const char* path_;
34 const char* resource_; 36 const char* resource_;
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 monitor_ = new Monitor(); 758 monitor_ = new Monitor();
757 ASSERT(monitor_ != NULL); 759 ASSERT(monitor_ != NULL);
758 // Grab the isolate create callback here to avoid race conditions with tests 760 // Grab the isolate create callback here to avoid race conditions with tests
759 // that change this after Dart_Initialize returns. 761 // that change this after Dart_Initialize returns.
760 create_callback_ = Isolate::CreateCallback(); 762 create_callback_ = Isolate::CreateCallback();
761 Dart::thread_pool()->Run(new RunServiceTask()); 763 Dart::thread_pool()->Run(new RunServiceTask());
762 } 764 }
763 765
764 766
765 void ServiceIsolate::KillServiceIsolate() { 767 void ServiceIsolate::KillServiceIsolate() {
768 if (!FLAG_shutdown) {
769 return;
770 }
766 { 771 {
767 MonitorLocker ml(monitor_); 772 MonitorLocker ml(monitor_);
768 shutting_down_ = true; 773 shutting_down_ = true;
769 } 774 }
770 Isolate::KillIfExists(isolate_); 775 Isolate::KillIfExists(isolate_);
771 { 776 {
772 MonitorLocker ml(monitor_); 777 MonitorLocker ml(monitor_);
773 while (shutting_down_) { 778 while (shutting_down_) {
774 ml.Wait(); 779 ml.Wait();
775 } 780 }
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
842 return result; 847 return result;
843 } 848 }
844 Dart_Handle source = GetSource(url_string); 849 Dart_Handle source = GetSource(url_string);
845 if (Dart_IsError(source)) { 850 if (Dart_IsError(source)) {
846 return source; 851 return source;
847 } 852 }
848 return Dart_LoadSource(library, url, source, 0, 0); 853 return Dart_LoadSource(library, url, source, 0, 0);
849 } 854 }
850 855
851 } // namespace dart 856 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698