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

Unified Diff: runtime/vm/os_thread_win.h

Issue 1410493002: Complete support for Windows TLS destructors (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/os_thread.h ('k') | runtime/vm/os_thread_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/os_thread_win.h
diff --git a/runtime/vm/os_thread_win.h b/runtime/vm/os_thread_win.h
index 5dc9b189f58c6a1e670922d337a4d7507f631912..15b5ba84a5d161f913c41788c10003d6eeb96468 100644
--- a/runtime/vm/os_thread_win.h
+++ b/runtime/vm/os_thread_win.h
@@ -116,6 +116,55 @@ class MonitorData {
DISALLOW_COPY_AND_ASSIGN(MonitorData);
};
+
+typedef void (*ThreadDestructor) (void* parameter);
+
+
+class ThreadLocalEntry {
+ public:
+ ThreadLocalEntry(ThreadLocalKey key, ThreadDestructor destructor)
+ : key_(key),
+ destructor_(destructor) {
+ }
+
+ ThreadLocalKey key() const {
+ return key_;
+ }
+
+
+ ThreadDestructor destructor() const {
+ return destructor_;
+ }
+
+ private:
+ ThreadLocalKey key_;
+ ThreadDestructor destructor_;
+
+ DISALLOW_ALLOCATION(ThreadLocalEntry);
+};
+
+
+template<typename T>
+class MallocGrowableArray;
+
+
+class ThreadLocalData : public AllStatic {
+ private:
+ static void AddThreadLocal(ThreadLocalKey key, ThreadDestructor destructor);
+ static void RemoveThreadLocal(ThreadLocalKey key);
+
+ static void RunDestructors();
+
+ static Mutex* mutex_;
+ static MallocGrowableArray<ThreadLocalEntry>* thread_locals_;
+
+ static void InitOnce();
+ static void Shutdown();
+
+ friend class OS;
+ friend class OSThread;
+};
+
} // namespace dart
#endif // VM_OS_THREAD_WIN_H_
« no previous file with comments | « runtime/vm/os_thread.h ('k') | runtime/vm/os_thread_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698