X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;ds=sidebyside;f=folly%2FRandom.h;h=25ebf8e51dd7e12afe299ee119afacebcbc67216;hb=16b7f86299f935fc16d38d72a8b497e2ab4a1d4f;hp=8930526edd239aea14ff8ecc4c741231edb4e0c7;hpb=ce64f0f685111ac24c7a321ea56d0c3524621df1;p=folly.git diff --git a/folly/Random.h b/folly/Random.h index 8930526e..25ebf8e5 100644 --- a/folly/Random.h +++ b/folly/Random.h @@ -1,5 +1,5 @@ /* - * Copyright 2014 Facebook, Inc. + * Copyright 2015 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -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 - localInstance; static result_type getImpl(LocalInstancePRNG* local); LocalInstancePRNG* local_;