Add call_once, wrapper around std::call_once with a fast path
authorLovro Puzar <lovro@fb.com>
Wed, 17 Feb 2016 13:22:40 +0000 (05:22 -0800)
committerfacebook-github-bot-0 <folly-bot@fb.com>
Wed, 17 Feb 2016 14:20:26 +0000 (06:20 -0800)
commit13de7740c5b72cf7adafad79a22757ab0848120a
tree070b0ba999de5621897733a9cea32261610afede
parent8f7fb4fb3707c342634470a67aeea851f6f0fcca
Add call_once, wrapper around std::call_once with a fast path

Summary: std::call_once is a nice API but the current GCC implementation is slower than it needs to be.  Adding a header-only wrapper with an additional atomic bool.

Reviewed By: luciang

Differential Revision: D2938884

fb-gh-sync-id: 5939c94fe62a1523053dcff26c880ecaec9e1150
shipit-source-id: 5939c94fe62a1523053dcff26c880ecaec9e1150
folly/CallOnce.h [new file with mode: 0644]
folly/Makefile.am
folly/Random.cpp
folly/detail/Futex.cpp
folly/test/CallOnceTest.cpp [new file with mode: 0644]