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

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

Issue 2240283002: Reload: Don't free the saved class table while another thread may be reading it. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: . Created 4 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
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 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after
1102 isolate->heap()->CollectAllGarbage(); 1102 isolate->heap()->CollectAllGarbage();
1103 VerifyCanonicalVisitor check_canonical(thread); 1103 VerifyCanonicalVisitor check_canonical(thread);
1104 isolate->heap()->IterateObjects(&check_canonical); 1104 isolate->heap()->IterateObjects(&check_canonical);
1105 } 1105 }
1106 #endif // DEBUG 1106 #endif // DEBUG
1107 return success; 1107 return success;
1108 } 1108 }
1109 1109
1110 1110
1111 void Isolate::DeleteReloadContext() { 1111 void Isolate::DeleteReloadContext() {
1112 // Another thread may be in the middle of GetClassForHeapWalkAt.
1113 Thread* thread = Thread::Current();
1114 SafepointOperationScope safepoint_scope(thread);
1115
1112 delete reload_context_; 1116 delete reload_context_;
1113 reload_context_ = NULL; 1117 reload_context_ = NULL;
1114 } 1118 }
1115 #endif // !PRODUCT 1119 #endif // !PRODUCT
1116 1120
1117 1121
1118 void Isolate::DoneFinalizing() { 1122 void Isolate::DoneFinalizing() {
1119 NOT_IN_PRODUCT( 1123 NOT_IN_PRODUCT(
1120 if (IsReloading()) { 1124 if (IsReloading()) {
1121 reload_context_->FinalizeLoading(); 1125 reload_context_->FinalizeLoading();
(...skipping 1772 matching lines...) Expand 10 before | Expand all | Expand 10 after
2894 void IsolateSpawnState::DecrementSpawnCount() { 2898 void IsolateSpawnState::DecrementSpawnCount() {
2895 ASSERT(spawn_count_monitor_ != NULL); 2899 ASSERT(spawn_count_monitor_ != NULL);
2896 ASSERT(spawn_count_ != NULL); 2900 ASSERT(spawn_count_ != NULL);
2897 MonitorLocker ml(spawn_count_monitor_); 2901 MonitorLocker ml(spawn_count_monitor_);
2898 ASSERT(*spawn_count_ > 0); 2902 ASSERT(*spawn_count_ > 0);
2899 *spawn_count_ = *spawn_count_ - 1; 2903 *spawn_count_ = *spawn_count_ - 1;
2900 ml.Notify(); 2904 ml.Notify();
2901 } 2905 }
2902 2906
2903 } // namespace dart 2907 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698