Fennel: LockHolderId Class Reference (original) (raw)
LockHolderId encapsulates the identity of an entity which can hold a lock, currently either a transaction or a thread. More...
#include <[LockHolderId.h](LockHolderId%5F8h-source.html)>
| Public Member Functions | |
|---|---|
| LockHolderId () | |
| Creates a new null holder. | |
| LockHolderId (TxnId txnId) | |
| Creates a new ID corresponding to a transaction or thread ID. | |
| void | assignFrom (TxnId txnId) |
| Assigns identity from a transaction or thread ID. | |
| bool | isNull () const |
| **Returns:**whether this holder is null (has not been assigned an identity) | |
| void | setNull () |
| Sets this holder to null. | |
| int | operator== (LockHolderId const &other) const |
| Compares this holder to another. | |
| Private Types | |
| enum | HolderType { TYPE_NULL, TYPE_THREAD, TYPE_TXN } |
| Private Attributes | |
| TxnId | holderId |
| HolderType | holderType |
Detailed Description
LockHolderId encapsulates the identity of an entity which can hold a lock, currently either a transaction or a thread.
Version:
Id
//open/dev/fennel/synch/LockHolderId.h#5
Definition at line 35 of file LockHolderId.h.
Member Enumeration Documentation
Enumerator:
| TYPE_NULL | | | -------------- | | | TYPE_THREAD | | | TYPE_TXN | |
Definition at line 37 of file LockHolderId.h.
Constructor & Destructor Documentation
| LockHolderId::LockHolderId | ( | | ) | [inline, explicit] | | -------------------------- | - | | - | -------------------- |
| LockHolderId::LockHolderId | ( | TxnId | txnId | ) | [inline, explicit] |
|---|
Creates a new ID corresponding to a transaction or thread ID.
Parameters:
| txnId | ID of a transaction, or IMPLICIT_TXN_ID to assign from the current thread ID |
|---|
Definition at line 113 of file LockHolderId.h.
References assignFrom().
Member Function Documentation
| void LockHolderId::assignFrom | ( | TxnId | txnId | ) | [inline] |
|---|
| bool LockHolderId::isNull | ( | | ) | const [inline] | | ------------------------- | - | | - | ---------------- |
| void LockHolderId::setNull | ( | | ) | [inline] | | -------------------------- | - | | - | ---------- |
| int LockHolderId::operator== | ( | LockHolderId const & | other | ) | const [inline] |
|---|
Compares this holder to another.
Parameters:
| other | other holder to compare |
|---|
Returns:
whether the two holders identify the same entity (or are both null)
Definition at line 123 of file LockHolderId.h.
References holderId, and holderType.
00124 { 00125 return (holderId == other.holderId) 00126 && (holderType == other.holderType); 00127 }
Member Data Documentation
The documentation for this class was generated from the following file:
- /home/pub/open/dev/fennel/synch/LockHolderId.h
