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

Unified Diff: runtime/vm/thread.cc

Issue 1391013006: Call known TLS destructors on Windows (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « runtime/vm/thread.h ('k') | runtime/vm/thread_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/thread.cc
diff --git a/runtime/vm/thread.cc b/runtime/vm/thread.cc
index 46da230d3bc0af3224ecb1914e4b491c50a80c81..069d2d51c349a212b2e868ba3c56199dd97851e0 100644
--- a/runtime/vm/thread.cc
+++ b/runtime/vm/thread.cc
@@ -537,5 +537,15 @@ Thread* ThreadIterator::Next() {
return current;
}
+#if defined(TARGET_OS_WINDOWS)
+// This function is invoked by |OnThreadExit| found in os_thread_win.cc.
+void ThreadCleanupOnExit() {
+ // Windows does not support TLS destructors (see os_thread_win.cc for
+ // context). As a work around, we maintain a list of functions to be
+ // executed when a thread exits in |OnThreadExit| in os_thread_win.cc.
+ Thread::CleanUp();
+}
+#endif
+
} // namespace dart
« no previous file with comments | « runtime/vm/thread.h ('k') | runtime/vm/thread_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698