MySQL 9.1.0
Source Code Documentation
|
Implements atomic ops on BgcTicket object. More...
#include <atomic_bgc_ticket.h>
Public Member Functions | |
virtual | ~AtomicBgcTicket ()=default |
AtomicBgcTicket (AtomicBgcTicket const &)=delete | |
AtomicBgcTicket (AtomicBgcTicket &&)=delete | |
AtomicBgcTicket & | operator= (AtomicBgcTicket const &)=delete |
AtomicBgcTicket & | operator= (AtomicBgcTicket &&)=delete |
AtomicBgcTicket (const BgcTicket &src) | |
Copying ctor. More... | |
AtomicBgcTicket (const BgcTicket::ValueType &src) | |
Copying ctor. More... | |
AtomicBgcTicketGuard | scoped_lock (bool inc_next_before_release=false) |
Creates the "lock" that is held for the returned AtomicBgcTicketGuard object lifetime. More... | |
AtomicBgcTicketGuard | scoped_lock (const BgcTicket &next_value) |
Creates the "lock" that is held for the returned AtomicBgcTicketGuard object lifetime. More... | |
void | store (const BgcTicket &value) |
Ticket mutator, atomic store op. More... | |
BgcTicket | load () const |
Ticket accessor, atomic load op. More... | |
Protected Member Functions | |
std::pair< BgcTicket, BgcTicket > | set_in_use (bool inc_next_before_acquire=false, bool inc_next_before_release=false) |
Sets ticket synchronization value to "in use". More... | |
void | set_used (const BgcTicket &next_value) |
Sets ticket synchronization value to "used/free". More... | |
Protected Attributes | |
memory::Aligned_atomic< BgcTicket::ValueType > | m_ticket |
internal ticket representation More... | |
Friends | |
class | AtomicBgcTicketGuard |
class | BgcTicket |
std::ostream & | operator<< (std::ostream &os, const AtomicBgcTicket &arg) |
Stream operator impl for AtomicBgcTicket class. More... | |
Implements atomic ops on BgcTicket object.
Impl based on Aligned_atomic
|
virtualdefault |
|
delete |
|
delete |
binlog::AtomicBgcTicket::AtomicBgcTicket | ( | const BgcTicket & | src | ) |
Copying ctor.
[in] | src | Pattern to copy from |
AtomicBgcTicket is created based on src BgcTicket object
|
explicit |
Copying ctor.
[in] | src | Pattern to copy from |
AtomicBgcTicket is created based on src ValueType object
BgcTicket binlog::AtomicBgcTicket::load | ( | ) | const |
Ticket accessor, atomic load op.
|
delete |
|
delete |
AtomicBgcTicketGuard binlog::AtomicBgcTicket::scoped_lock | ( | bool | inc_next_before_release = false | ) |
Creates the "lock" that is held for the returned AtomicBgcTicketGuard object lifetime.
[in] | inc_next_before_release | Before "release" operation, ticket value is set to the value+1 in case inc_next_before_acquire is equal false and inc_next_before_release is equal to true |
AtomicBgcTicketGuard binlog::AtomicBgcTicket::scoped_lock | ( | const BgcTicket & | next_value | ) |
Creates the "lock" that is held for the returned AtomicBgcTicketGuard object lifetime.
|
protected |
Sets ticket synchronization value to "in use".
Only one thread is allowed to get into the critical section that starts with the "set_in_use" op and ends with the "set_used"
[in] | inc_next_before_acquire | During the "acquire" operation, ticket value is set to the value+1 in case inc_next_before_acquire is equal to true. |
[in] | inc_next_before_release | Before "release" operation, ticket value is set to the value+1 in case inc_next_before_acquire is equal false. |
|
protected |
Sets ticket synchronization value to "used/free".
Only one thread is allowed to get into the critical section that starts with the "set_in_use" op and ends with the "set_used"
[in] | next_value | Next ticket value set during the "release" op. |
void binlog::AtomicBgcTicket::store | ( | const BgcTicket & | value | ) |
Ticket mutator, atomic store op.
[in] | value | Sets atomically m_ticket internal variable to "value" |
|
friend |
|
friend |
|
friend |
Stream operator impl for AtomicBgcTicket class.
[in] | os | Reference to stream obj |
[in] | arg | Constant reference to AtomicBgcTicket object |
|
protected |
internal ticket representation