libfoedus-core
FOEDUS Core Library

An entry in CLL/RLL for system transactions. More...

Detailed Description

An entry in CLL/RLL for system transactions.

Analogous to LockEntry, but a bit different because system transactions also take page locks.

Definition at line 80 of file sysxct_impl.hpp.

#include <sysxct_impl.hpp>

Classes

struct  LessThan
 for std::binary_search() etc without creating the object More...
 

Public Member Functions

void clear ()
 
void set (UniversalLockId lock_id, uintptr_t lock, bool page_lock)
 
RwLockableXctIdget_as_record_lock () const
 
storage::Pageget_as_page_lock () const
 
bool is_locked () const
 
bool operator< (const SysxctLockEntry &rhs) const
 

Public Attributes

UniversalLockId universal_lock_id_
 Used to order locks in canonical order. More...
 
uintptr_t lock_
 Virtual address of a record lock. More...
 
McsBlockIndex mcs_block_
 0 means the lock not taken. More...
 
bool page_lock_
 Whether this is a pge lock or not. More...
 
bool used_in_this_run_
 whether the lock was requested at least once in this run. More...
 

Friends

std::ostream & operator<< (std::ostream &o, const SysxctLockEntry &v)
 Debugging. More...
 

Member Function Documentation

void foedus::xct::SysxctLockEntry::clear ( )
inline

Definition at line 109 of file sysxct_impl.hpp.

References foedus::xct::kNullUniversalLockId.

109  {
110  universal_lock_id_ = 0;
112  mcs_block_ = 0;
113  page_lock_ = false;
114  used_in_this_run_ = false;
115  }
bool used_in_this_run_
whether the lock was requested at least once in this run.
McsBlockIndex mcs_block_
0 means the lock not taken.
Definition: sysxct_impl.hpp:98
bool page_lock_
Whether this is a pge lock or not.
UniversalLockId universal_lock_id_
Used to order locks in canonical order.
Definition: sysxct_impl.hpp:85
const UniversalLockId kNullUniversalLockId
This never points to a valid lock, and also evaluates less than any vaild alocks. ...
Definition: xct_id.hpp:137
uintptr_t lock_
Virtual address of a record lock.
Definition: sysxct_impl.hpp:91
storage::Page* foedus::xct::SysxctLockEntry::get_as_page_lock ( ) const
inline

Definition at line 129 of file sysxct_impl.hpp.

References ASSERT_ND, and lock_.

Referenced by foedus::xct::operator<<().

129  {
131  return reinterpret_cast<storage::Page*>(lock_);
132  }
bool page_lock_
Whether this is a pge lock or not.
#define ASSERT_ND(x)
A warning-free wrapper macro of assert() that has no performance effect in release mode even when 'x'...
Definition: assert_nd.hpp:72
uintptr_t lock_
Virtual address of a record lock.
Definition: sysxct_impl.hpp:91

Here is the caller graph for this function:

RwLockableXctId* foedus::xct::SysxctLockEntry::get_as_record_lock ( ) const
inline

Definition at line 125 of file sysxct_impl.hpp.

References ASSERT_ND, and lock_.

Referenced by foedus::xct::operator<<().

125  {
127  return reinterpret_cast<RwLockableXctId*>(lock_);
128  }
bool page_lock_
Whether this is a pge lock or not.
#define ASSERT_ND(x)
A warning-free wrapper macro of assert() that has no performance effect in release mode even when 'x'...
Definition: assert_nd.hpp:72
uintptr_t lock_
Virtual address of a record lock.
Definition: sysxct_impl.hpp:91

Here is the caller graph for this function:

bool foedus::xct::SysxctLockEntry::is_locked ( ) const
inline

Definition at line 134 of file sysxct_impl.hpp.

134 { return mcs_block_ != 0; }
McsBlockIndex mcs_block_
0 means the lock not taken.
Definition: sysxct_impl.hpp:98
bool foedus::xct::SysxctLockEntry::operator< ( const SysxctLockEntry rhs) const
inline

Definition at line 136 of file sysxct_impl.hpp.

References universal_lock_id_.

136  {
137  return universal_lock_id_ < rhs.universal_lock_id_;
138  }
UniversalLockId universal_lock_id_
Used to order locks in canonical order.
Definition: sysxct_impl.hpp:85
void foedus::xct::SysxctLockEntry::set ( UniversalLockId  lock_id,
uintptr_t  lock,
bool  page_lock 
)
inline

Definition at line 117 of file sysxct_impl.hpp.

Referenced by foedus::xct::SysxctLockList::batch_get_or_add_entries(), and foedus::xct::SysxctLockList::get_or_add_entry().

117  {
118  universal_lock_id_ = lock_id;
119  lock_ = lock;
120  mcs_block_ = 0;
121  page_lock_ = page_lock;
122  used_in_this_run_ = true;
123  }
bool used_in_this_run_
whether the lock was requested at least once in this run.
McsBlockIndex mcs_block_
0 means the lock not taken.
Definition: sysxct_impl.hpp:98
bool page_lock_
Whether this is a pge lock or not.
UniversalLockId universal_lock_id_
Used to order locks in canonical order.
Definition: sysxct_impl.hpp:85
uintptr_t lock_
Virtual address of a record lock.
Definition: sysxct_impl.hpp:91

Here is the caller graph for this function:

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  o,
const SysxctLockEntry v 
)
friend

Debugging.

Definition at line 35 of file sysxct_impl.cpp.

35  {
36  o << "<SysxctLockEntry>"
37  << "<LockId>" << v.universal_lock_id_ << "</LockId>"
38  << "<used>" << v.used_in_this_run_ << "</used>";
39  if (v.mcs_block_) {
40  o << "<mcs_block_>" << v.mcs_block_ << "</mcs_block_>";
41  if (v.page_lock_) {
42  o << v.get_as_page_lock()->get_header();
43  } else {
44  o << *(v.get_as_record_lock());
45  }
46  } else {
47  o << "<NotLocked />";
48  }
49  o << "</SysxctLockEntry>";
50  return o;
51 }

Member Data Documentation

uintptr_t foedus::xct::SysxctLockEntry::lock_

Virtual address of a record lock.

Either this or the page_lock is non-null. Either RwLockableXctId* or Page*

Definition at line 91 of file sysxct_impl.hpp.

Referenced by get_as_page_lock(), and get_as_record_lock().

McsBlockIndex foedus::xct::SysxctLockEntry::mcs_block_

0 means the lock not taken.

Definition at line 98 of file sysxct_impl.hpp.

Referenced by foedus::xct::operator<<().

bool foedus::xct::SysxctLockEntry::page_lock_

Whether this is a pge lock or not.

Definition at line 101 of file sysxct_impl.hpp.

Referenced by foedus::xct::operator<<().

UniversalLockId foedus::xct::SysxctLockEntry::universal_lock_id_

Used to order locks in canonical order.

So far universal_lock_id_ == reinterpret_cast<uintptr_t>(lock_).

Definition at line 85 of file sysxct_impl.hpp.

Referenced by foedus::xct::SysxctLockList::batch_get_or_add_entries(), foedus::xct::SysxctLockList::is_try_mode_required(), foedus::xct::SysxctLockEntry::LessThan::operator()(), operator<(), and foedus::xct::operator<<().

bool foedus::xct::SysxctLockEntry::used_in_this_run_

whether the lock was requested at least once in this run.

If false, we will not include this lock in next run.

Definition at line 107 of file sysxct_impl.hpp.

Referenced by foedus::xct::SysxctLockList::compress_entries(), and foedus::xct::operator<<().


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