RAII opaque for AtomicBgcTicket (set in use/set used synchronization operations in constructor/destructor)
More...
#include <atomic_bgc_ticket_guard.h>
RAII opaque for AtomicBgcTicket (set in use/set used synchronization operations in constructor/destructor)
◆ ~AtomicBgcTicketGuard()
binlog::AtomicBgcTicketGuard::~AtomicBgcTicketGuard |
( |
| ) |
|
|
virtual |
◆ AtomicBgcTicketGuard() [1/3]
◆ AtomicBgcTicketGuard() [2/3]
Constructor.
- Parameters
-
[in] | bgcTicket | Reference to atomic ticket instance |
[in] | next_value | Before "release" operation, ticket value is set to the next_value. |
◆ AtomicBgcTicketGuard() [3/3]
binlog::AtomicBgcTicketGuard::AtomicBgcTicketGuard |
( |
AtomicBgcTicket & |
bgcTicket, |
|
|
bool |
inc_next_before_release = false |
|
) |
| |
|
protected |
Constructor.
- Parameters
-
[in] | bgcTicket | Reference to atomic ticket instance |
[in] | inc_next_before_release | Before "release" operation, ticket value is set to the value+1 in case inc_next_before_release is equal to true |
◆ get_next()
BgcTicket binlog::AtomicBgcTicketGuard::get_next |
( |
| ) |
const |
"Next" value accessor.
Before "release" operation, ticket value is set to the returned "next" ticket.
- Returns
- BgcTicket with next ticket value
◆ get_prev()
BgcTicket binlog::AtomicBgcTicketGuard::get_prev |
( |
| ) |
const |
"Previous" value accessor.
During the "acquire" operation, ticket value is set to the returned "previous" ticket.
- Returns
- BgcTicket with previous ticket value
◆ operator=()
◆ set_next()
void binlog::AtomicBgcTicketGuard::set_next |
( |
const BgcTicket & |
next | ) |
|
Function used to manually manipulate the "next" ticket value.
The 'set_next' function will determine the value of the ticket after the "release" operation. It can be the same value, but it might be the value incremented by one, depending on the current usage.
- Parameters
-
next | Next value for the AtomicBgcTicket referenced by this instance of the AtomicBgcTicketGuard |
◆ AtomicBgcTicket
◆ m_next_value
BgcTicket binlog::AtomicBgcTicketGuard::m_next_value |
|
protected |
value to be set during the "release" op
◆ m_prev_value
BgcTicket binlog::AtomicBgcTicketGuard::m_prev_value |
|
protected |
previous ticket value, obtained during the "acquire" op
◆ m_ref
std::reference_wrapper<AtomicBgcTicket> binlog::AtomicBgcTicketGuard::m_ref |
|
protected |
For threads to synchronize properly, AtomicBgcTicketGuard instances must operate on the same instance of AtomicBgcTicket.
This is a reference to atomic Bgc ticket instance, used by different instances of the BgcTicketGuard class (e.g. front/back ticket in BgcTicketManager class)
The documentation for this class was generated from the following files: