Optimize perf of EventBase with new option.
[folly.git] / folly / Random.h
index 09cf7a1795890f4301d0d085be735bb4ee6cd9c7..6846e1d177feb8c4d5dfbf8167da3dba00174007 100644 (file)
@@ -20,7 +20,7 @@
 #include <type_traits>
 #include <random>
 #include <stdint.h>
-#include "folly/ThreadLocal.h"
+#include <folly/ThreadLocal.h>
 
 #if __GNUC_PREREQ(4, 8) && !defined(ANDROID)
 #include <ext/random>
@@ -64,18 +64,10 @@ class ThreadLocalPRNG {
   }
   friend class Random;
 
-  ThreadLocalPRNG() {
-    local_ = localInstance.get();
-    if (!local_) {
-      local_ = initLocal();
-    }
-  }
+  ThreadLocalPRNG();
 
  private:
   class LocalInstancePRNG;
-  static LocalInstancePRNG* initLocal();
-  static folly::ThreadLocalPtr<ThreadLocalPRNG::LocalInstancePRNG>
-    localInstance;
 
   static result_type getImpl(LocalInstancePRNG* local);
   LocalInstancePRNG* local_;
@@ -253,6 +245,6 @@ inline uint32_t randomNumberSeed() {
 
 }
 
-#include "folly/Random-inl.h"
+#include <folly/Random-inl.h>
 
 #endif