Start compiling a bit of `-Wshadow`
[folly.git] / folly / Singleton.cpp
index 66321bfdc1e47c4e9a37285b405d8b0bb39cef51..8e9cd99b0763138bd8eb7c61819da5c293a61703 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015 Facebook, Inc.
+ * Copyright 2016 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -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() {