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

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

Issue 1275853008: Reverts VM thread cleanup (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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/service_isolate.h ('k') | runtime/vm/thread.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) 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"
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 ASSERT(monitor_ == NULL); 742 ASSERT(monitor_ == NULL);
743 monitor_ = new Monitor(); 743 monitor_ = new Monitor();
744 ASSERT(monitor_ != NULL); 744 ASSERT(monitor_ != NULL);
745 // Grab the isolate create callback here to avoid race conditions with tests 745 // Grab the isolate create callback here to avoid race conditions with tests
746 // that change this after Dart_Initialize returns. 746 // that change this after Dart_Initialize returns.
747 create_callback_ = Isolate::CreateCallback(); 747 create_callback_ = Isolate::CreateCallback();
748 Dart::thread_pool()->Run(new RunServiceTask()); 748 Dart::thread_pool()->Run(new RunServiceTask());
749 } 749 }
750 750
751 751
752 void ServiceIsolate::KillServiceIsolate() {
753 {
754 MonitorLocker ml(monitor_);
755 shutting_down_ = true;
756 }
757 Isolate::KillIsolate(isolate_);
758 {
759 MonitorLocker ml(monitor_);
760 while (shutting_down_) {
761 ml.Wait();
762 }
763 }
764 }
765
766
767 void ServiceIsolate::Shutdown() { 752 void ServiceIsolate::Shutdown() {
768 if (!IsRunning()) { 753 if (!IsRunning()) {
769 if (isolate_ != NULL) {
770 // TODO(johnmccutchan,turnidge) When it is possible to properly create
771 // the VMService object and set up its shutdown handler in the service
772 // isolate's main() function, this case will no longer be possible and
773 // can be removed.
774 KillServiceIsolate();
775 }
776 return; 754 return;
777 } 755 }
778 { 756 {
779 MonitorLocker ml(monitor_); 757 MonitorLocker ml(monitor_);
780 shutting_down_ = true; 758 shutting_down_ = true;
781 } 759 }
782 SendServiceExitMessage(); 760 SendServiceExitMessage();
783 { 761 {
784 MonitorLocker ml(monitor_); 762 MonitorLocker ml(monitor_);
785 while (shutting_down_ && (port_ != ILLEGAL_PORT)) { 763 while (shutting_down_ && (port_ != ILLEGAL_PORT)) {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 return result; 807 return result;
830 } 808 }
831 Dart_Handle source = GetSource(url_string); 809 Dart_Handle source = GetSource(url_string);
832 if (Dart_IsError(source)) { 810 if (Dart_IsError(source)) {
833 return source; 811 return source;
834 } 812 }
835 return Dart_LoadSource(library, url, source, 0, 0); 813 return Dart_LoadSource(library, url, source, 0, 0);
836 } 814 }
837 815
838 } // namespace dart 816 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/service_isolate.h ('k') | runtime/vm/thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698