Collaboration diagram for Thread-Local Variables:
![]() |
Each use of TLS_STRUCT creates a thread_local object.
See also tls_tricks.
Variables | |
static __thread bool | tls_tricks::tls_manager::_thread_initialized |
static __thread latch_holder_t * | latch_holder_t::thread_local_holders |
Linked list of all latches held by this thread. | |
static __thread latch_holder_t * | latch_holder_t::thread_local_freelist |
Pool of unused latch_holder_t instances. |
__thread latch_holder_t * latch_holder_t::thread_local_holders [static, inherited] |
Linked list of all latches held by this thread.
Every time we want to grab a latch, we have to create a latch_holder_t; we do that with the holder_search class, which searches the per-thread list below to make sure we `(this thread) don't already hold the latch and if not, it creates a new latch_holder_t for the new latch acquisition, and stuffs the latch_holder_t in this list. If we do already have hold the latch in some capacity, the holder_search returns that existing latch_holder_t. So we can tell if this thread holds a given latch, and we can find all latches held by this thread, but we can't find all the holders of a given latch.
__thread latch_holder_t * latch_holder_t::thread_local_freelist [static, inherited] |
Pool of unused latch_holder_t instances.
Ready for recycling. These structures are first taken from the global heap but put on this list for reuse rather than free-ed. When the thread is destroyed, the items on this list are returned to the global heap.