Add MAX_STATIC_CONSTRUCTOR_PRIORITY to PthreadKeyUnregister
authorAndrii Grynenko <andrii@fb.com>
Thu, 11 Feb 2016 02:02:27 +0000 (18:02 -0800)
committerfacebook-github-bot-0 <folly-bot@fb.com>
Thu, 11 Feb 2016 02:20:26 +0000 (18:20 -0800)
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

index 0f6e84a6538d4256ace082bed95fc76fe4cfddde..c78005ec7c65c60bf6adb868748a377532a5f8a7 100644 (file)
@@ -17,6 +17,7 @@
 
 namespace folly { namespace threadlocal_detail {
 
+MAX_STATIC_CONSTRUCTOR_PRIORITY
 PthreadKeyUnregister PthreadKeyUnregister::instance_;
 
 }}