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

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

Issue 1409723007: Hack around TLS destructors firing after the process exits round 2 (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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
« runtime/bin/run_vm_tests.cc ('K') | « runtime/vm/os_thread_win.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) 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/thread_interrupter.h" 5 #include "vm/thread_interrupter.h"
6 6
7 #include "vm/flags.h" 7 #include "vm/flags.h"
8 #include "vm/lockers.h" 8 #include "vm/lockers.h"
9 #include "vm/os.h" 9 #include "vm/os.h"
10 #include "vm/simulator.h" 10 #include "vm/simulator.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 // Join the thread. 105 // Join the thread.
106 ASSERT(interrupter_thread_id_ != OSThread::kInvalidThreadJoinId); 106 ASSERT(interrupter_thread_id_ != OSThread::kInvalidThreadJoinId);
107 OSThread::Join(interrupter_thread_id_); 107 OSThread::Join(interrupter_thread_id_);
108 interrupter_thread_id_ = OSThread::kInvalidThreadJoinId; 108 interrupter_thread_id_ = OSThread::kInvalidThreadJoinId;
109 109
110 if (FLAG_trace_thread_interrupter) { 110 if (FLAG_trace_thread_interrupter) {
111 OS::Print("ThreadInterrupter shut down.\n"); 111 OS::Print("ThreadInterrupter shut down.\n");
112 } 112 }
113 } 113 }
114 114
115
115 // Delay between interrupts. 116 // Delay between interrupts.
116 void ThreadInterrupter::SetInterruptPeriod(intptr_t period) { 117 void ThreadInterrupter::SetInterruptPeriod(intptr_t period) {
117 if (shutdown_) { 118 if (shutdown_) {
118 return; 119 return;
119 } 120 }
120 ASSERT(initialized_); 121 ASSERT(initialized_);
121 ASSERT(period > 0); 122 ASSERT(period > 0);
122 interrupt_period_ = period; 123 interrupt_period_ = period;
123 } 124 }
124 125
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 } 219 }
219 { 220 {
220 // Signal to main thread we are exiting. 221 // Signal to main thread we are exiting.
221 MonitorLocker shutdown_ml(monitor_); 222 MonitorLocker shutdown_ml(monitor_);
222 thread_running_ = false; 223 thread_running_ = false;
223 shutdown_ml.Notify(); 224 shutdown_ml.Notify();
224 } 225 }
225 } 226 }
226 227
227 } // namespace dart 228 } // namespace dart
OLDNEW
« runtime/bin/run_vm_tests.cc ('K') | « runtime/vm/os_thread_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698