Zero  0.1.0
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
bucket_t Class Reference

Lock table hash table bucket. More...

#include <lock_bucket.h>

Public Member Functions

 bucket_t ()
 
 ~bucket_t ()
 
lock_queue_tfind_lock_queue (uint32_t hash)
 

Private Member Functions

lock_queue_tfind_lock_queue_nocreate (uint32_t hash)
 
lock_queue_tfind_lock_queue_create (uint32_t hash)
 

Private Attributes

srwlock_t _queue_latch
 
lock_queue_t_queue
 

Friends

void lock_core_m::dump (std::ostream &o)
 
void lock_core_m::assert_empty () const
 

Detailed Description

Lock table hash table bucket.

Lock table's hash table is lock_core_m::_htab, which is an array of bucket_t's. Each bucket contains a linked list of lock_queue_t's and a latch that protects that list's _next pointers.

Constructor & Destructor Documentation

§ bucket_t()

bucket_t::bucket_t ( )
inline

§ ~bucket_t()

bucket_t::~bucket_t ( )
inline

Member Function Documentation

§ find_lock_queue()

lock_queue_t * bucket_t::find_lock_queue ( uint32_t  hash)
inline

Finds or creates a lock queue for the given hash value.

§ find_lock_queue_create()

lock_queue_t * bucket_t::find_lock_queue_create ( uint32_t  hash)
inlineprivate

Find a lock queue for the given hash, creating a new lock queue if needed.

Returns
never returns NULL.

§ find_lock_queue_nocreate()

lock_queue_t * bucket_t::find_lock_queue_nocreate ( uint32_t  hash)
inlineprivate

Tries to find a lock queue for the given hash without creating a new lock queue. As this is a readonly access, much faster!

Returns
returns NULL if not found. In that case, call find_lock_queue_create().

Friends And Related Function Documentation

§ lock_core_m::assert_empty

void lock_core_m::assert_empty ( ) const
friend

§ lock_core_m::dump

void lock_core_m::dump ( std::ostream &  o)
friend

friending for unsafe dump as an exception to the latch protocol here.

Member Data Documentation

§ _queue

lock_queue_t* bucket_t::_queue
private

Pointer to the first lock_queue_ of our list; protected by _queue_latch.

§ _queue_latch

srwlock_t bucket_t::_queue_latch
private

Protects accesses to _queue and the _next pointers of the lock_queue_t's on that list only. We only keep this latch until we find or create the right lock_queue_t.


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