Zero  0.1.0
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
latch_holder_t Class Reference

Indicates a latch is held by this thread. More...

#include <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_tthread_local_holders
 Linked list of all latches held by this thread. More...
 
static __thread latch_holder_tthread_local_freelist
 Pool of unused latch_holder_t instances. More...
 

Private Member Functions

latch_holder_toperator= (latch_holder_t const &other)
 

Private Attributes

std::thread::id _threadid
 

Detailed Description

Indicates a latch is 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 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.

See also
holder_search

Constructor & Destructor Documentation

§ latch_holder_t()

latch_holder_t::latch_holder_t ( )
inline

Member Function Documentation

§ operator=()

latch_holder_t& latch_holder_t::operator= ( latch_holder_t const &  other)
private

§ operator==()

bool latch_holder_t::operator== ( latch_holder_t const &  other) const
inline

§ print()

void latch_holder_t::print ( ostream &  o) const

Member Data Documentation

§ _count

int latch_holder_t::_count

§ _latch

latch_t* latch_holder_t::_latch

§ _mode

latch_mode_t latch_holder_t::_mode

§ _next

latch_holder_t* latch_holder_t::_next

§ _prev

latch_holder_t* latch_holder_t::_prev

§ _threadid

std::thread::id latch_holder_t::_threadid
private

The documentation for this class was generated from the following files: