19 #include <boost/intrusive/list.hpp> 62 typename Tag = detail::DefaultTag,
63 typename Make = detail::DefaultMake<T>,
64 typename TLTag =
_t<std::conditional<
72 using NodeBase = boost::intrusive::list_base_hook<
73 boost::intrusive::link_mode<boost::intrusive::auto_unlink>>;
79 Node(
Wrapper*& cache_,
bool& stale_) : cache(cache_), stale(stale_) {
81 wrapper.caches.push_front(*
this);
95 boost::intrusive::list<Node, boost::intrusive::constant_time_size<false>>;
103 alignas(
alignof(
T))
unsigned char storage[
sizeof(
T)];
115 (void)
new (storage) S(Make{}());
120 (void)Make{}(storage);
123 for (
auto& node : caches) {
136 static auto& entry = *detail::createGlobal<WrapperTL, Tag>();
147 CHECK_EQ(check, &cache) <<
"inline function static thread_local merging";
148 static thread_local
bool stale;
149 static thread_local
Node node(cache, stale);
150 return !stale && node.cache ? *node.cache :
getWrapper();
205 #define FOLLY_DECLARE_REUSED(name, ...) \ 206 struct __folly_reused_type_##name { \ 207 __VA_ARGS__ object; \ 210 ::folly::SingletonThreadLocal<__folly_reused_type_##name>::get().object; \ 211 auto __folly_reused_g_##name = ::folly::makeGuard([&] { name.clear(); })
#define FOLLY_ALWAYS_INLINE
Accessor accessAllThreads() const
static FOLLY_NOINLINE Wrapper & getWrapper()
static WrapperTL::Accessor accessAllThreads()
—— Concurrent Priority Queue Implementation ——
FOLLY_EXPORT static FOLLY_NOINLINE WrapperTL & getWrapperTL()
static const char *const value
boost::intrusive::list_base_hook< boost::intrusive::link_mode< boost::intrusive::auto_unlink >> NodeBase
SingletonThreadLocal()=delete
Node(Wrapper *&cache_, bool &stale_)
bool check(const dynamic &schema, const dynamic &value, bool check=true)