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 |