proxygen
|
#include <ThreadLocalDetail.h>
Public Member Functions | |
~PthreadKeyUnregister () | |
Static Public Member Functions | |
static void | registerKey (pthread_key_t key) |
Static Public Attributes | |
static constexpr size_t | kMaxKeys = 1UL << 16 |
Private Member Functions | |
constexpr | PthreadKeyUnregister () |
void | registerKeyImpl (pthread_key_t key) |
Private Attributes | |
MicroSpinLock | lock_ |
size_t | size_ |
pthread_key_t | keys_ [kMaxKeys] |
Static Private Attributes | |
static PthreadKeyUnregister | instance_ |
Friends | |
struct | folly::threadlocal_detail::PthreadKeyUnregisterTester |
We want to disable onThreadExit call at the end of shutdown, we don't care about leaking memory at that point.
Otherwise if ThreadLocal is used in a shared library, onThreadExit may be called after dlclose().
This class has one single static instance; however since it's so widely used, directly or indirectly, by so many classes, we need to take care to avoid problems stemming from the Static Initialization/Destruction Order Fiascos. Therefore this class needs to be constexpr-constructible, so as to avoid the need for this to participate in init/destruction order.
Definition at line 256 of file ThreadLocalDetail.h.
|
inline |
Definition at line 260 of file ThreadLocalDetail.h.
|
inlineprivate |
Only one global instance should exist, hence this is private. See also the important note at the top of this class about constexpr
usage.
Definition at line 281 of file ThreadLocalDetail.h.
|
inlinestatic |
Definition at line 271 of file ThreadLocalDetail.h.
Referenced by folly::threadlocal_detail::StaticMetaBase::getThreadEntryList(), and folly::threadlocal_detail::StaticMetaBase::StaticMetaBase().
|
inlineprivate |
Definition at line 284 of file ThreadLocalDetail.h.
|
friend |
Definition at line 282 of file ThreadLocalDetail.h.
|
staticprivate |
Definition at line 296 of file ThreadLocalDetail.h.
Referenced by folly::threadlocal_detail::StaticMetaBase::pushBackUnlocked().
|
private |
Definition at line 294 of file ThreadLocalDetail.h.
|
static |
Definition at line 258 of file ThreadLocalDetail.h.
|
private |
Definition at line 292 of file ThreadLocalDetail.h.
|
private |
Definition at line 293 of file ThreadLocalDetail.h.