21 #include <unordered_map> 28 class StaticSingletonManagerImpl {
30 void* create(std::type_info
const& key,
void* (*make)(
void*),
void* ctx) {
32 std::lock_guard<std::mutex>
lock(e.mutex);
33 return e.ptr ? e.ptr : (e.ptr = make(ctx));
42 Entry& entry(std::type_info
const& key) {
45 return e ? *e : *(e =
new Entry());
48 std::unordered_map<std::type_index, Entry*>
map_;
56 static auto& instance = *
new StaticSingletonManagerImpl();
57 return instance.create(key, make, ctx);
—— Concurrent Priority Queue Implementation ——
std::unordered_map< std::type_index, Entry * > map_
auto lock(SynchronizedLocker...lockersIn) -> std::tuple< typename SynchronizedLocker::LockedPtr... >
FOLLY_ALWAYS_INLINE static FOLLY_ATTR_VISIBILITY_HIDDEN void * create_(F &creator)