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

Unified Diff: runtime/vm/thread_interrupter.cc

Issue 1275353005: VM thread shutdown. (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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/thread_interrupter.cc
diff --git a/runtime/vm/thread_interrupter.cc b/runtime/vm/thread_interrupter.cc
index 23e6c22fc4df17365db199763c694b035edc0769..776a2ac1d820dc4683efaca142a06058be6eb061 100644
--- a/runtime/vm/thread_interrupter.cc
+++ b/runtime/vm/thread_interrupter.cc
@@ -101,24 +101,12 @@ void ThreadInterrupter::Shutdown() {
OS::Print("ThreadInterrupter shutting down.\n");
}
}
-#if defined(TARGET_OS_WINDOWS)
- // On Windows, a thread's exit-code can leak into the process's exit-code,
- // if exiting 'at same time' as the process ends. By joining with the thread
- // here, we avoid this race condition.
+
+ // Join the thread.
ASSERT(interrupter_thread_id_ != OSThread::kInvalidThreadId);
OSThread::Join(interrupter_thread_id_);
interrupter_thread_id_ = OSThread::kInvalidThreadId;
-#else
- // On non-Windows platforms, just wait for the thread interrupter to signal
- // that it has exited the loop.
- {
- MonitorLocker shutdown_ml(monitor_);
- while (thread_running_) {
- // Wait for thread to exit.
- shutdown_ml.Wait();
- }
- }
-#endif
+
if (FLAG_trace_thread_interrupter) {
OS::Print("ThreadInterrupter shut down.\n");
}

Powered by Google App Engine
This is Rietveld 408576698