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 a TLS list to make sure we(this thread) doesn't already hold the latch, and, if not, it creates a new latch_holder_t for the new latch acquisition. It then stuffs the latch_holder_t in the TLS list. If we do already have hold the latch in some capacity, the holder_search returns that existing latch_holder_t.
Definition at line 93 of file latch.h.
Public Member Functions | |
latch_holder_t () | |
bool | operator== (latch_holder_t const &other) const |
void | print (ostream &o) const |
Public Attributes | |
latch_t * | _latch |
latch_mode_t | _mode |
int | _count |
latch_holder_t * | _prev |
latch_holder_t * | _next |
Static Public Attributes | |
static __thread latch_holder_t * | thread_local_holders |
Linked list of all latches held by this thread. | |
static __thread latch_holder_t * | thread_local_freelist |
Pool of unused latch_holder_t instances. |