Zero  0.1.0
Variables
TLS

Variables

static __thread bool tls_tricks::tls_manager::_thread_initialized
 
static __thread latch_holder_tlatch_holder_t::thread_local_holders
 Linked list of all latches held by this thread. More...
 
static __thread latch_holder_tlatch_holder_t::thread_local_freelist
 Pool of unused latch_holder_t instances. More...
 

Detailed Description

The following are some of the thread-local variables defined in the storage manager libraries. (This is far from a complete list.)

Each use of TLS_STRUCT creates a thread_local object.

See also tls_tricks.

Variable Documentation

§ _thread_initialized

__thread bool tls_manager::_thread_initialized
static

§ thread_local_freelist

__thread latch_holder_t * latch_holder_t::thread_local_freelist
static

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.

See also
latch_holder_t

§ thread_local_holders

__thread latch_holder_t * latch_holder_t::thread_local_holders
static

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.

See also
latch_holder_t