1. 29 Oct, 2014 22 commits
    • Dave Watson's avatar
      Add missing headers · 6ba489cb
      Dave Watson authored
      Summary: Jenkins ci build was broken for a while, so we missed these  in contbuild results
      
      Test Plan: watch ci build for fbthrift
      
      Reviewed By: hans@fb.com
      
      Subscribers: doug, fugalh, njormrod, folly-diffs@
      
      FB internal diff: D1641515
      6ba489cb
    • Dave Watson's avatar
      AsyncSocket · 95084352
      Dave Watson authored
      Summary:
      Move async socket to folly.
      
      Changes:
      * Made an AsyncSocketException type instead of TTransportException: Some of the exceptions didn't fit nicely in to std::exception types (like TIMED_OUT).  There are some wrappers in thrift/lib/cpp/async to convert back to TTransportException, so all existing code still compiles.
      * Moved read/write callbacks out of AsyncTransport: filters are going to want to do the read/write stuff separately (see revproxy/tunnel/filters, and discussions in D1483148).
      
      Test Plan:
      fbconfig -r thrift; fbmake runtests
      contbuild should catch everything else - exception types shouldn't change for existing code
      
      Reviewed By: dcsommer@fb.com
      
      Subscribers: mshneer, folly-diffs@, trunkagent, doug, alandau, bmatheny, njormrod, fugalh, jsedgwick
      
      FB internal diff: D1587625
      95084352
    • Hans Fugal's avatar
      (wangle) fix race in Core::detachOne() · eec32a76
      Hans Fugal authored
      Summary:
      In D1618240 I introduced a race condition in `detachOne()`, where `detached_` is incremented and then tested. If the promise and future are racing, they can both see `detached_ == 2` in the conditional, and then they'll both try to free the Core object. This fixes that.
      
      It also fixes a related problem (which actually showed up more often with the test I wrote), where we transition into the Done state before setting the value, and then `maybeCallback()` observes the state is Done (because we're just reading an atomic, not grabbing the lock, which is intentional), tries to execute the callback, but `folly::Optional` throws an exception because the value hasn't been set yet (at least in debug it does). I should have listened to my gut and kept the state assignment after the transition action in the first place.
      
      Test Plan: New unit test
      
      Reviewed By: jsedgwick@fb.com
      
      Subscribers: trunkagent, net-systems@, fugalh, exa, njormrod, folly-diffs@, mnd
      
      FB internal diff: D1636490
      
      Tasks: 5438209
      
      Blame Revision: D1618240
      eec32a76
    • Hans Fugal's avatar
      unrevert "(wangle) express current Core functionality with a state machine"" · 3d6fc64f
      Hans Fugal authored
      Summary: Reverts D1633874. Companion to D1636490 which fixes the bug.
      
      Test Plan:
      git reverting code that was git reverted and hasn't changed in the interim
      Won't be checked in without the companion bugfix diff (D1636490)
      
      Reviewed By: davejwatson@fb.com
      
      Subscribers: trunkagent, net-systems@, fugalh, exa, njormrod, folly-diffs@
      
      FB internal diff: D1636487
      
      Tasks: 5438209
      
      Blame Revision: D1633874
      3d6fc64f
    • Dave Watson's avatar
      Remove some leftover apache paths · 4a29942e
      Dave Watson authored
      Summary: EventBaseManager was moved to folly, we shouldn't have deps on apache
      
      Test Plan: fbconfig -r folly/experimental/wangle/concurrency; fbmake runtests
      
      Reviewed By: hans@fb.com
      
      Subscribers: doug, fugalh, njormrod, folly-diffs@
      
      FB internal diff: D1636006
      4a29942e
    • Hans Fugal's avatar
      Revert "(wangle) express current Core functionality with a state machine" · 23cf10c5
      Hans Fugal authored
      Summary:
      
      Test Plan:
      
      Reviewed By: harishs@fb.com
      
      Subscribers: net-systems@, fugalh, exa, njormrod, folly-diffs@
      
      FB internal diff: D1633874
      
      Tasks: 5438209
      23cf10c5
    • Hans Fugal's avatar
      fix Future<const T>::value() · f85b2abe
      Hans Fugal authored
      Summary: I'm still a little mystified how one makes a Future<const T> (I tried to make one explicitly in a test and failed), but this is clearly the bug @reedriley sees in https://phabricator.fb.com/D1620805#21
      
      Test Plan:
      fbconfig titan/cachius/test
      fbmake
      
      Reviewed By: reedriley@fb.com
      
      Subscribers: trunkagent, net-systems@, fugalh, exa, njormrod, reedriley, folly-diffs@
      
      FB internal diff: D1630378
      
      Blame Revision: D1620805
      f85b2abe
    • Dave Watson's avatar
      move asyncserversocket to folly · a44155cb
      Dave Watson authored
      Summary:
      Changes:
      * namespace to folly
      * some std::chrono replacesments
      * Moves shutdownSocketSet stuff to thriftserver instead of in the socket itself.
      * Changes exception types.  I don't see anywhere that uses the TAsync*SERVER*socket exceptions depending on the TTransport type, but I could be wrong? I don't really know what to do about the exception types
      
      unittests still postponed overnight.
      
      Test Plan:
      fbconfig -r thrift; fbmake runtests
      fbconfig -r proxygen; fbmake runtests
      
      Reviewed By: dcsommer@fb.com
      
      Subscribers: hphp-diffs@, ps, folly-diffs@, anca, trunkagent, jsedgwick, fugalh, doug, alandau, bmatheny, njormrod
      
      FB internal diff: D1579187
      a44155cb
    • James Sedgwick's avatar
      add PortableSpinLock.h to Makefile, unbreak fbthrift build · 1701e3d7
      James Sedgwick authored
      Summary:
      fix fbthrift build, broken in D1621717
      
      I wonder if it'd be possible to lint against this somehow. The jenkins failures are easy to miss especially on folly diffs with lots of failure noise (in this case it was still postponed)
      
      Test Plan: wait for jenkins
      
      Reviewed By: davejwatson@fb.com
      
      Subscribers: njormrod, folly-diffs@
      
      FB internal diff: D1630833
      1701e3d7
    • Andrii Grynenko's avatar
      Schedule destroyInstances in registrationComplete · 05fbb13d
      Andrii Grynenko authored
      Summary: This makes it more likely that SingletonVaultDestructor won't be created after atexit calls.
      
      Test Plan: unit test
      
      Reviewed By: chip@fb.com
      
      Subscribers: hphp-diffs@, ps, njormrod, folly-diffs@
      
      FB internal diff: D1629804
      
      Tasks: 5353022
      05fbb13d
    • Hans Fugal's avatar
      (wangle) fix after-delete assert · fd915b73
      Hans Fugal authored
      Summary:
      This would cause debug builds to do a bad thing (access the variable `this->detached_` within an assert, after `delete this`).
      
      Test Plan: unit tests
      
      Hopefully now that we have a dummy cpp file in `folly/wangle/detail` contbuild
      will pick it up and all the dependencies will also run their tests.
      Right now, we suspect maybe maelstrom (@wez) and adinvoicer and zookeeper
      (@jying) and probably others are seeing this in unit test failures (esp. if
      they use asan, which is rightly detecting read after free). Hoping contbuild
      will catch them.
      
      Reviewed By: davejwatson@fb.com
      
      Subscribers: net-systems@, fugalh, exa, njormrod, folly-diffs@, wez, dcapel, jying, cgheorghe
      
      FB internal diff: D1630301
      
      Tasks: 5424546, 5435720
      
      Blame Revision: D1618240
      fd915b73
    • Hans Fugal's avatar
      waitFor race workaround · 5aa44fb2
      Hans Fugal authored
      Summary: Fixing the race will take some more thought. Probably a condvar. For now, I'm turning waitFor into a spinlock instead.
      
      Test Plan: new unit test that deadlocks before the workaround
      
      Reviewed By: jsedgwick@fb.com
      
      Subscribers: trunkagent, net-systems@, fugalh, exa, njormrod, folly-diffs@
      
      FB internal diff: D1628015
      
      Tasks: 5427828
      5aa44fb2
    • Hans Fugal's avatar
      (wangle) Fix a couple compilation issues · 4459989b
      Hans Fugal authored
      Summary: If you try to include files in a weird (but not incorrect) order you get compilation errors. No longer!
      
      Test Plan: new dummy `cpp_binary` target
      
      Reviewed By: davejwatson@fb.com
      
      Subscribers: trunkagent, folly-diffs@, net-systems@, fugalh, exa, njormrod
      
      FB internal diff: D1621083
      4459989b
    • Hans Fugal's avatar
      (wangle) Interrupts (and therefore, cancellation) · 831405dc
      Hans Fugal authored
      Summary:
      Modeled very closely after Finagle's interrupts. Compare with https://github.com/twitter/util/blob/master/util-core/src/main/scala/com/twitter/util/Promise.scala if you like.
      The basic idea is the promise holder can register an interrupt handler, and then interrupts will call that handler. A typical handler would fulfil the promise with an exception (or special value) indicating that it was interrupted (if it was interrupted in time).
      Raising an interrupt does not prevent setting a value or callbacks executing or any of that - it is only advisory to the promise holder.
      
      Test Plan: I wrote some unit tests.
      
      Reviewed By: davejwatson@fb.com
      
      Subscribers: folly-diffs@, net-systems@, fugalh, exa, hannesr, njormrod
      
      FB internal diff: D1620805
      
      Tasks: 4618297
      831405dc
    • Hans Fugal's avatar
      (wangle) express current Core functionality with a state machine · 1be516d1
      Hans Fugal authored
      Summary:
      This is a refactor of the current functionality to use a state machine (inheriting from `FSM`). This will make it easier to extend to do cancellation and Future collapsing. Performance is the same, maybe slightly faster (abt 1%). (I might be a little conservative with the atomics, it might be worth going through and reasoning about whether they all need to be atomic).
      
      The state machine is two states, Waiting (no value), and Done (has a value). Transitioning to Done will execute the callback if it exists and we are active. Otherwise the callback will happen when it is set and active is true.
      
      There is a subjective balancing act in place here, between making a state for every single mutable bit of information (which results in an explosion of states: hasValue X hasCallback X isActive X isCancelled …), and finding a sweet spot of expressivity. This isn't too far from the way Twitter did it, though we don't (yet) have all the states they have (and they don't have the concept of hot/cold futures). But I got there by way of replacing the `mutex_` with the state, after changing all those variables to atomics so they didn't need mutex protection (resulting in only `callback_` and `result_` needing it). I expect the state machine will morph as the rest of the functionality is added, but hopefully it will be easier to understand and keep correct (that's the idea anyway).
      
      Test Plan: Tests still pass (and not by accident, I made several awesome mistakes along the way).
      
      Reviewed By: davejwatson@fb.com
      
      Subscribers: net-systems@, fugalh, exa, njormrod
      
      FB internal diff: D1618240
      
      Tasks: 4618297
      1be516d1
    • Hans Fugal's avatar
      (wangle) Core cleanup · 4c7a8438
      Hans Fugal authored
      Summary:
      Just some cleaning hose in `detail::Core`.
      - rename `fulfil` to `setResult`
      - and `value_` to `result_`
      - remove unnecessary helper methods (I can be convinced to keep them if you like them)
      
      Test Plan: mechanical changes, tests still pass
      
      Reviewed By: davejwatson@fb.com
      
      Subscribers: trunkagent, folly-diffs@, net-systems@, fugalh, exa, njormrod
      
      FB internal diff: D1618161
      4c7a8438
    • Hans Fugal's avatar
      (wangle) deprecate Later and ThreadGate · 72984487
      Hans Fugal authored
      Summary:
      Later is now superfluous. Just hold a deactivated future (e.g. one returned by `Future::via`), and then activate (or destruct) it when you're ready.
      ThreadGate has proven to be too rigid and too heavyweight to be really useful. And is superfluous now with `Future::via`. e.g.
      f.via(east).then(a1).then(a2).via(west).then(b1).then(b2);
      
      This is stage one of removing these: mark them deprecated.
      Stage two will be for me to change all existing usages in our code to not use them.
      Stage three will be to rip these out altogether.
      
      Test Plan:
      Everything still builds and works, but now with deprecation warnings.
      
      fbconfig -r \
      common/smc/cpp/tests \
      folly/wangle \
      langtech/audiens \
      messaging/avscan \
      messaging/maelstrom \
      neteng/traffic_manager \
      notifications/nudge/service \
      tao/client \
      zeus/datashuttle
      fbmake runtests
      
      Reviewed By: jsedgwick@fb.com
      
      Subscribers: net-systems@, fugalh, exa, njormrod, folly-diffs@
      
      FB internal diff: D1626412
      
      Tasks: 5409538
      72984487
    • Hans Fugal's avatar
      remove fireAndForget · 410194d1
      Hans Fugal authored
      Summary: It was deprecated, now is unused.
      
      Test Plan:
      fbgs
      check contbuild
      
      Reviewed By: hannesr@fb.com
      
      Subscribers: trunkagent, net-systems@, fugalh, exa, njormrod, folly-diffs@
      
      FB internal diff: D1624221
      410194d1
    • Hans Fugal's avatar
      (wangle) dummy cpp files · 6c03fe98
      Hans Fugal authored
      Summary: for great contbuild
      
      Test Plan: these projects still build. contbuild should start picking them up, based on discussion with @robbert
      
      Reviewed By: robbert@fb.com
      
      Subscribers: trunkagent, net-systems@, fugalh, exa, mwa, jgehring, fuegen, njormrod, folly-diffs@, robbert
      
      FB internal diff: D1624206
      
      Tasks: 5399744
      6c03fe98
    • Hans Fugal's avatar
      (FSM) updateState with unprotected action · 4c68315c
      Hans Fugal authored
      Summary:
      Like the magic macros. As it says in the comment, this can lead to nicer code.
      Also added/moved a couple examples to the top of `test/FSM.cpp`.
      
      Test Plan: new tests
      
      Reviewed By: davejwatson@fb.com
      
      Subscribers: trunkagent, net-systems@, fugalh, exa, njormrod
      
      FB internal diff: D1618184
      4c68315c
    • James Sedgwick's avatar
      sync wangle to makefile · af8be97b
      James Sedgwick authored
      Summary: as above
      
      Test Plan:
      
      Reviewed By: davejwatson@fb.com
      
      Subscribers: fugalh, njormrod
      
      FB internal diff: D1589439
      af8be97b
    • Sean Cannella's avatar
      Support NotificationQueue on iOS/Android · fc0cd893
      Sean Cannella authored
      Summary:
      This is the last of the changes to make folly and thrift portable. The old
      thrift SpinLock implementation is exactly we
      want here so port this into folly. If someone later makes efficeint
      versions of MicroSpinLock for platforms other than x64 they can easily
      be plugged in without changing the calling code.
      
      Test Plan: compiled on multiple platforms
      
      Reviewed By: alandau@fb.com
      
      Subscribers: folly-diffs@, ldbrandy, trunkagent, alandau, bmatheny, njormrod, mshneer, shikong, benyluo, kmdent, fma, ranjeeth, subodh
      
      FB internal diff: D1621717
      
      Tasks: 5183325
      fc0cd893
  2. 17 Oct, 2014 18 commits
    • dcsommer's avatar
      Bump version to 13:0 · acc54589
      dcsommer authored
      acc54589
    • Pavlo Kushnir's avatar
      Fix mcrouter opensource build · eeffd525
      Pavlo Kushnir authored
      Summary: mcrouter now uses folly::Singleton.
      
      Test Plan: visual
      
      Reviewed By: andrii@fb.com
      
      Subscribers: njormrod
      
      FB internal diff: D1622647
      eeffd525
    • Max Wang's avatar
      Fix typo in folly::Optional · f3e0f107
      Max Wang authored
      Test Plan: yes
      
      Reviewed By: delong.j@fb.com
      f3e0f107
    • Sean Cannella's avatar
      Fix one missing conditional for Android · 581f790c
      Sean Cannella authored
      Summary:
      pthread_atfork isn't defined in the Android NDK (and therefore is not actually supported even though it's in bionic/libc) so don't call it there.
      
      Test Plan: compiled on Linux, Android
      
      Reviewed By: meyering@fb.com
      
      Subscribers: njormrod, shikong, kmdent, fma
      
      FB internal diff: D1620584
      
      Tasks: 5183325
      581f790c
    • Tom Jackson's avatar
      Fixing broken bits test · 7cc48094
      Tom Jackson authored
      Summary: Buffer size calculation had fallen out of sync with the actual test code. Good thing we have ASAN!
      
      Test Plan: Run the test with address santizer.
      
      Reviewed By: mpawlowski@fb.com
      
      Subscribers: mpawlowski, trunkagent, njormrod
      
      FB internal diff: D1619472
      
      Tasks: 5325399
      7cc48094
    • Max Wang's avatar
      Allow Optional<T> {=,!}= T comparisons in folly::Optional · 3550ca21
      Max Wang authored
      Summary:
      I can see how {<,>}{,=} comparisons might be ambiguous, but equality
      should never be, so let's allow it.
      
      Test Plan: tests
      
      Reviewed By: tjackson@fb.com
      
      Subscribers: trunkagent, njormrod
      
      FB internal diff: D1618088
      3550ca21
    • Dave Watson's avatar
      move shutdown socket set · 71431a93
      Dave Watson authored
      Summary:
      Move shutdownsocketset to folly, since it is a dep of the asyncsockets
      
      Previoulsy tried moving it in to the server directly: D1583629, but had issues - close(fd) is called before the error callback, so we can't remove the fd before the close, which is essential to it working properly.
      
      Just move it to folly instead.
      
      Test Plan: fbconfig -r thrift/lib/cpp thrift/lib/cpp2; fbmake runtests
      
      Reviewed By: dcsommer@fb.com
      
      Subscribers: mshneer, trunkagent, fugalh, jsedgwick, doug, alandau, bmatheny, njormrod
      
      FB internal diff: D1594950
      71431a93
    • Sean Cannella's avatar
      Conditionals for iOS / Android compilation · d28152cd
      Sean Cannella authored
      Summary:
      Conditional changes required to compile on iOS and Android.
      
      Test Plan: compiled on all platforms
      
      Reviewed By: meyering@fb.com
      
      Subscribers: kmccray, trunkagent, shilin, njormrod, ranjeeth, subodh, bmatheny
      
      FB internal diff: D1618028
      
      Tasks: 5183325
      d28152cd
    • Andrii Grynenko's avatar
      Don't throw in Singleton::get() if singleton is alive · fa0c6eae
      Andrii Grynenko authored
      Summary:
      This is a fix for situations where you know that something is keeping singleton alive (by getting a weak_ptr and locking it), and request a singleton instance via get() method (if e.g. it's hard to pass a pointer to singleton instance from a method which locked it). If shutdown was scheduled - an exception was previously thrown even though the object was not destroyed yet.
      
      This simplifies conversion of legacy code to folly::Singleton.
      
      Test Plan:
      fbconfig -r gatehouse/usersets/tests
      fbmake runtests
      
      Reviewed By: chip@fb.com
      
      Subscribers: trunkagent, njormrod
      
      FB internal diff: D1619311
      fa0c6eae
    • Subodh Iyengar's avatar
      Remove global init of ThreadLocal in Random · a4eda9d3
      Subodh Iyengar authored
      Summary:
      Remove global initialization of ThreadLocal in Random
      See https://gcc.gnu.org/onlinedocs/gcc-4.8.3/gcc/Thread-Local.html
      
      Static initializers and thread locals don't mix well, and we're seeing
      some crashes which we think might be related to this.
      
      Test Plan: Unit tests
      
      Reviewed By: seanc@fb.com
      
      Subscribers: trunkagent, seanc, njormrod
      
      FB internal diff: D1617455
      a4eda9d3
    • James Sedgwick's avatar
      support for move-only types · 187cf0a0
      James Sedgwick authored
      Summary: universal references and perfect forwarding to the rescue
      
      Test Plan: added demonstrative unit tests
      
      Reviewed By: hans@fb.com
      
      Subscribers: trunkagent, fugalh, njormrod, bmatheny
      
      FB internal diff: D1592032
      
      Tasks: 5283342
      187cf0a0
    • James Sedgwick's avatar
      merge wangle/Executor.h and experimental/wangle/concurrent/Executor.h · ea078b87
      James Sedgwick authored
      Summary:
      the one in concurrent/ is a bit more generic, so I kept that as Executor and renamed the existing one ScheduledExecutor
      
      because Hans is surfing I took the liberty of renaming Action->Func as an alias for std::function<void()>, because I think it's more reflective
      also kept the version of add() that doesn't force rvalue-reference as it's more user friendly and probably not less performant in common cases (insert reference to "want speed? pass by value" here)
      
      Test Plan: compiled some major relevant bits, will let contbuild show me anything I missed
      
      Reviewed By: hans@fb.com
      
      Subscribers: trunkagent, rushix, fbcode-common-diffs@, fugalh, msk, njormrod
      
      FB internal diff: D1591237
      
      Tasks: 5279196
      ea078b87
    • Andrii Grynenko's avatar
      Schedule destroyInstances only when first singleton is created · e5e3fde0
      Andrii Grynenko authored
      Summary:
      Right now destroyInstances is scheduled when SingletonVault is requested. This may change singleton destruction order (folly::Singleton-managed vs unmanaged singletons) when new singleton is registered with folly::Singleton (no matter if it is even used).
      This diff changes it to be more stable.
      
      Test Plan: servicerouter unittests
      
      Reviewed By: chip@fb.com
      
      Subscribers: njormrod, mshneer
      
      FB internal diff: D1615213
      
      Tasks: 5353022
      e5e3fde0
    • Sean Cannella's avatar
      Fix clang test compilation failures · ca4b4d09
      Sean Cannella authored
      Summary:
      While working on other code I noticed folly stopped compiling
      with clang. Fix that.
      
      Test Plan: fbmake runtests (clang and gcc)
      
      Reviewed By: lucian@fb.com
      
      Subscribers: mathieubaudet, njormrod, bmatheny
      
      FB internal diff: D1618189
      ca4b4d09
    • Hans Fugal's avatar
      (wangle) Use MicroSpinLock · 7b3f1d1d
      Hans Fugal authored
      Summary: For great speed
      
      Test Plan:
      Before
      ============================================================================
      folly/wangle/test/Benchmark.cpp                 relative  time/iter  iters/s
      ============================================================================
      constantFuture                                             241.19ns    4.15M
      promiseAndFuture                                 100.32%   240.42ns    4.16M
      withThen                                          44.63%   540.47ns    1.85M
      ----------------------------------------------------------------------------
      oneThen                                                    519.20ns    1.93M
      twoThens                                          62.83%   826.41ns    1.21M
      fourThens                                         36.80%     1.41us  708.75K
      hundredThens                                       1.79%    29.05us   34.42K
      ----------------------------------------------------------------------------
      no_contention                                                4.82ms   207.27
      contention                                        62.91%     7.67ms   130.39
      ============================================================================
      
      After
      ============================================================================
      folly/wangle/test/Benchmark.cpp                 relative  time/iter  iters/s
      ============================================================================
      constantFuture                                             159.79ns    6.26M
      promiseAndFuture                                 101.23%   157.84ns    6.34M
      withThen                                          41.78%   382.47ns    2.61M
      ----------------------------------------------------------------------------
      oneThen                                                    358.23ns    2.79M
      twoThens                                          63.07%   568.00ns    1.76M
      fourThens                                         36.89%   971.07ns    1.03M
      hundredThens                                       1.76%    20.34us   49.17K
      ----------------------------------------------------------------------------
      no_contention                                                3.75ms   266.75
      contention                                        59.83%     6.27ms   159.59
      ============================================================================
      
      That's a 150% speedup.
      
      Reviewed By: davejwatson@fb.com
      
      Subscribers: net-systems@, fugalh, exa, njormrod
      
      FB internal diff: D1617363
      
      Tasks: 5278220
      7b3f1d1d
    • Jun LI's avatar
      Defer query string parsing from ctor to getQueryParams() · 8ae778e3
      Jun LI authored
      Summary:
      Query string parsing uses a lot of CPU, it happens in ctor killing CPU
      even in users that are not interested in query string. Move it to
      getQueryParams().
      
      Test Plan:
      fbconfig folly/test
      fbmake runtests_dbg
      
      Reviewed By: ldemailly@fb.com
      
      Subscribers: trunkagent, njormrod, zellux
      
      FB internal diff: D1604973
      
      Tasks: 5304484
      
      Blame Revision: https://phabricator.fb.com/D1455158
      8ae778e3
    • Pavlo Kushnir's avatar
      Fix opensource build · 4a9aef96
      Pavlo Kushnir authored
      Summary: D1615707 moved State.h to Core.h, but didn't update Makefile.am
      
      Test Plan: visual
      
      Reviewed By: davejwatson@fb.com
      
      Subscribers: fugalh, njormrod
      
      FB internal diff: D1617562
      
      Blame Revision: D1615707
      4a9aef96
    • Daniel Sommermann's avatar
      Fix thread local random number generator static issue · 651eb23c
      Daniel Sommermann authored
      Summary:
      See https://gcc.gnu.org/onlinedocs/gcc-4.8.3/gcc/Thread-Local.html
      Thanks to @subodh for finding the first instance of this problem in the
      proxygen codebase.
      
      Test Plan:
      unit tests, tested proxygen unit tests on my laptop and I don't
      get segfaults on program exit now.
      
      Reviewed By: subodh@fb.com
      
      Subscribers: trunkagent, doug, njormrod, subodh
      
      FB internal diff: D1616149
      
      Tasks: 5217022
      651eb23c