From 4dc763b4e7188371c97bb3da3af0808e492ed7e6 Mon Sep 17 00:00:00 2001 From: Andrii Grynenko Date: Wed, 10 Feb 2016 18:02:27 -0800 Subject: [PATCH] Add MAX_STATIC_CONSTRUCTOR_PRIORITY to PthreadKeyUnregister Summary: We want onThreadExit to be canceled as late as possible. Otherwise accessAllThreads() may crash on shutdown (because ThreadEntry is destroyed, but not removed from the global list). Reviewed By: igorsugak Differential Revision: D2923435 fb-gh-sync-id: 3a8eef05844bb547c06db33cb96734df1169852a shipit-source-id: 3a8eef05844bb547c06db33cb96734df1169852a --- folly/detail/ThreadLocalDetail.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/folly/detail/ThreadLocalDetail.cpp b/folly/detail/ThreadLocalDetail.cpp index 0f6e84a6..c78005ec 100644 --- a/folly/detail/ThreadLocalDetail.cpp +++ b/folly/detail/ThreadLocalDetail.cpp @@ -17,6 +17,7 @@ namespace folly { namespace threadlocal_detail { +MAX_STATIC_CONSTRUCTOR_PRIORITY PthreadKeyUnregister PthreadKeyUnregister::instance_; }} -- 2.34.1