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

Unified Diff: runtime/vm/os_win.cc

Issue 1572913002: Disable TLS destructors on Windows before calling abort() for an ASSERT. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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
« runtime/platform/assert.cc ('K') | « runtime/platform/assert.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/os_win.cc
diff --git a/runtime/vm/os_win.cc b/runtime/vm/os_win.cc
index 1e055f4c45fe49f1301fdecb3d6111667775c719..603ade6a6fae471e107d06655a1cdcf634f14cca 100644
--- a/runtime/vm/os_win.cc
+++ b/runtime/vm/os_win.cc
@@ -19,6 +19,9 @@
namespace dart {
+// Defined in vm/os_thread_win.cc
+extern bool private_flag_windows_run_tls_destructors;
+
const char* OS::Name() {
return "windows";
}
@@ -404,12 +407,18 @@ void OS::Shutdown() {
void OS::Abort() {
+ // TODO(zra): Remove once VM shuts down cleanly.
+ private_flag_windows_run_tls_destructors = false;
abort();
}
void OS::Exit(int code) {
- exit(code);
+ // TODO(zra): Remove once VM shuts down cleanly.
+ private_flag_windows_run_tls_destructors = false;
+ // On Windows we use ExitProcess so that threads can't clobber the exit_code.
+ // See: https://code.google.com/p/nativeclient/issues/detail?id=2870
+ ::ExitProcess(code);
}
} // namespace dart
« runtime/platform/assert.cc ('K') | « runtime/platform/assert.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698