|
Zero
0.1.0
|
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_t * | thread_local_holders |
| Linked list of all latches held by this thread. More... | |
| static __thread latch_holder_t * | thread_local_freelist |
| Pool of unused latch_holder_t instances. More... | |
Private Member Functions | |
| latch_holder_t & | operator= (latch_holder_t const &other) |
Private Attributes | |
| std::thread::id | _threadid |
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.
|
inline |
|
private |
|
inline |
| void latch_holder_t::print | ( | ostream & | o | ) | const |
| int latch_holder_t::_count |
| latch_t* latch_holder_t::_latch |
| latch_mode_t latch_holder_t::_mode |
| latch_holder_t* latch_holder_t::_next |
| latch_holder_t* latch_holder_t::_prev |
|
private |
1.8.12