Commit b0174026 authored by Andrii Grynenko's avatar Andrii Grynenko Committed by facebook-github-bot-0

Fix Singleton/ThreadLocal destruction order crashes in buck dev builds

Summary: This adds a folly::Singleton->folly::ThreadLocal dependency to make sure folly::ThreadLocal is always loaded first. Otherwise PthreadKeyUnregister singleton is created after folly::Singleton storage, even though it has higher priority.

Reviewed By: andrewjcg

Differential Revision: D2931170

fb-gh-sync-id: 36392d76e98201f2b4416b4bbef451d6c0e8c69d
shipit-source-id: 36392d76e98201f2b4416b4bbef451d6c0e8c69d
parent 1a7befdb
......@@ -213,6 +213,10 @@ void SingletonVault::reenableInstances() {
}
void SingletonVault::scheduleDestroyInstances() {
// Add a dependency on folly::ThreadLocal to make sure all its static
// singletons are initalized first.
threadlocal_detail::StaticMeta<void>::instance();
class SingletonVaultDestructor {
public:
~SingletonVaultDestructor() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment