libfoedus-core
FOEDUS Core Library
|
An entry in CLL and RLL, representing a lock that is taken or will be taken. More...
An entry in CLL and RLL, representing a lock that is taken or will be taken.
This is a POD, and guaranteed to be init-ed/reset-ed by memzero and copied via memcpy. We initially had a separate entry object for RLL and CLL, but they were always the same. We might differentiate them later, but for now reuse the same code.
Definition at line 120 of file retrospective_lock_list.hpp.
#include <retrospective_lock_list.hpp>
Classes | |
struct | LessThan |
for std::binary_search() etc without creating the object More... | |
Public Member Functions | |
void | set (UniversalLockId id, RwLockableXctId *lock, LockMode preferred_mode, LockMode taken_mode) |
bool | is_locked () const |
bool | is_enough () const |
bool | operator< (const LockEntry &rhs) const |
Public Attributes | |
UniversalLockId | universal_lock_id_ |
Used to order locks in canonical order. More... | |
RwLockableXctId * | lock_ |
Virtual address of the lock. More... | |
LockMode | preferred_mode_ |
Whick lock mode we should take according to RLL. More... | |
LockMode | taken_mode_ |
Whick lock mode we have taken during the current run (of course initially kNoLock) More... | |
McsBlockIndex | mcs_block_ |
0 means the lock not taken. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &o, const LockEntry &v) |
Debugging. More... | |
|
inline |
Definition at line 163 of file retrospective_lock_list.hpp.
References preferred_mode_.
Referenced by foedus::xct::CurrentLockList::cancel_async_single_lock(), foedus::xct::Xct::on_record_read_take_locks_if_needed(), foedus::xct::CurrentLockList::retry_async_single_lock(), foedus::xct::CurrentLockList::try_async_single_lock(), and foedus::xct::CurrentLockList::try_or_acquire_single_lock().
|
inline |
Definition at line 162 of file retrospective_lock_list.hpp.
References foedus::xct::kNoLock.
Referenced by foedus::xct::CurrentLockList::retry_async_single_lock(), and foedus::xct::CurrentLockList::try_or_acquire_single_lock().
|
inline |
Definition at line 165 of file retrospective_lock_list.hpp.
References universal_lock_id_.
|
inline |
Definition at line 150 of file retrospective_lock_list.hpp.
Referenced by foedus::xct::CurrentLockList::batch_insert_write_placeholders(), foedus::xct::RetrospectiveLockList::construct(), and foedus::xct::CurrentLockList::get_or_add_entry().
|
friend |
RwLockableXctId* foedus::xct::LockEntry::lock_ |
Virtual address of the lock.
Definition at line 130 of file retrospective_lock_list.hpp.
Referenced by foedus::xct::CurrentLockList::cancel_async_single_lock(), foedus::xct::RetrospectiveLockList::clear_entries(), foedus::xct::CurrentLockList::clear_entries(), foedus::xct::lock_assert_sorted(), foedus::xct::operator<<(), foedus::xct::XctManagerPimpl::precommit_xct_lock(), foedus::xct::CurrentLockList::retry_async_single_lock(), foedus::xct::CurrentLockList::try_async_single_lock(), and foedus::xct::CurrentLockList::try_or_acquire_single_lock().
McsBlockIndex foedus::xct::LockEntry::mcs_block_ |
0 means the lock not taken.
mcs_block_ == 0 iff taken_mode_ == kNolock.
Definition at line 144 of file retrospective_lock_list.hpp.
Referenced by foedus::xct::CurrentLockList::cancel_async_single_lock(), foedus::xct::CurrentLockList::retry_async_single_lock(), foedus::xct::CurrentLockList::try_async_single_lock(), and foedus::xct::CurrentLockList::try_or_acquire_single_lock().
LockMode foedus::xct::LockEntry::preferred_mode_ |
Whick lock mode we should take according to RLL.
We might take a stronger lock than this
Definition at line 136 of file retrospective_lock_list.hpp.
Referenced by foedus::xct::CurrentLockList::batch_insert_write_placeholders(), foedus::xct::CurrentLockList::cancel_async_single_lock(), foedus::xct::RetrospectiveLockList::clear_entries(), foedus::xct::CurrentLockList::clear_entries(), foedus::xct::RetrospectiveLockList::construct(), foedus::xct::CurrentLockList::get_or_add_entry(), is_enough(), foedus::xct::operator<<(), foedus::xct::XctManagerPimpl::precommit_xct_lock(), foedus::xct::CurrentLockList::retry_async_single_lock(), foedus::xct::CurrentLockList::try_async_single_lock(), and foedus::xct::CurrentLockList::try_or_acquire_single_lock().
LockMode foedus::xct::LockEntry::taken_mode_ |
Whick lock mode we have taken during the current run (of course initially kNoLock)
Definition at line 139 of file retrospective_lock_list.hpp.
Referenced by foedus::xct::CurrentLockList::cancel_async_single_lock(), foedus::xct::RetrospectiveLockList::clear_entries(), foedus::xct::CurrentLockList::clear_entries(), foedus::xct::operator<<(), foedus::xct::XctManagerPimpl::precommit_xct_lock(), foedus::xct::CurrentLockList::retry_async_single_lock(), foedus::xct::CurrentLockList::try_async_single_lock(), and foedus::xct::CurrentLockList::try_or_acquire_single_lock().
UniversalLockId foedus::xct::LockEntry::universal_lock_id_ |
Used to order locks in canonical order.
So far universal_lock_id_ == reinterpret_cast<uintptr_t>(lock_).
Definition at line 125 of file retrospective_lock_list.hpp.
Referenced by foedus::xct::CurrentLockList::batch_insert_write_placeholders(), foedus::xct::RetrospectiveLockList::clear_entries(), foedus::xct::CurrentLockList::clear_entries(), foedus::xct::CurrentLockList::get_max_locked_id(), foedus::xct::CurrentLockListIteratorForWriteSet::next_writes(), foedus::xct::Xct::on_record_read_take_locks_if_needed(), foedus::xct::LockEntry::LessThan::operator()(), operator<(), foedus::xct::operator<<(), and foedus::xct::XctManagerPimpl::precommit_xct_lock().