MySQL 26.7.0
Source Code Documentation
mysql::csa::Transaction_conflict_manager Class Reference

Rescue thread for solving conflicts between transactions Main methods are: More...

#include <transaction_conflict_manager.h>

Public Types

using Elem_type = Rescue_task
 

Public Member Functions

void start ()
 Starts asynchronous thread that decodes jobs from the stream. More...
 
void stop ()
 Stops asynchronous thread, notifies it and and waits for notification that thread has been stopped and may be joined. More...
 
bool is_stopped () const
 Checks if stop has been requested. More...
 
bool is_error () const
 Check if provider has an error. More...
 
void enqueue (Rescue_task &&task)
 Preempt this transaction. More...
 

Private Types

using Thread_type = mysql::concurrency::Thread
 Thread type. More...
 
using Queue_type = mysql::concurrency::Locking_queue< Elem_type >
 

Private Member Functions

void run_thread ()
 Function executed by m_thread. More...
 

Private Attributes

Queue_type m_cache
 Queue into which decoder thread puts data jobs. More...
 
Thread_type m_thread
 Decoder thread object. More...
 
std::atomic< bool > m_end {false}
 Notification atomic for end of execution. More...
 
std::atomic< bool > m_is_stopped {false}
 Variable to gracefully stop the thread. More...
 
std::atomic< std::size_t > m_scheduled_tasks {0}
 The number of scheduled tasks. More...
 

Detailed Description

Rescue thread for solving conflicts between transactions Main methods are:

  • start : Runs asynchronous thread
  • stop : Stops execution and blocks until thread is joined
  • rollback: Schedules transaction to rollback
  • is_stopped : Checks whether stop has been requested

Member Typedef Documentation

◆ Elem_type

◆ Queue_type

◆ Thread_type

Member Function Documentation

◆ enqueue()

void mysql::csa::Transaction_conflict_manager::enqueue ( Rescue_task &&  task)

Preempt this transaction.

◆ is_error()

bool mysql::csa::Transaction_conflict_manager::is_error ( ) const

Check if provider has an error.

Returns
True in case an error occurred, false otherwise

◆ is_stopped()

bool mysql::csa::Transaction_conflict_manager::is_stopped ( ) const

Checks if stop has been requested.

Returns
True if stop has been requested internally (error) or externally (log wait for update)

◆ run_thread()

void mysql::csa::Transaction_conflict_manager::run_thread ( )
private

Function executed by m_thread.

◆ start()

void mysql::csa::Transaction_conflict_manager::start ( )

Starts asynchronous thread that decodes jobs from the stream.

◆ stop()

void mysql::csa::Transaction_conflict_manager::stop ( )

Stops asynchronous thread, notifies it and and waits for notification that thread has been stopped and may be joined.

Next, joins the thread.

Member Data Documentation

◆ m_cache

Queue_type mysql::csa::Transaction_conflict_manager::m_cache
private

Queue into which decoder thread puts data jobs.

◆ m_end

std::atomic<bool> mysql::csa::Transaction_conflict_manager::m_end {false}
private

Notification atomic for end of execution.

◆ m_is_stopped

std::atomic<bool> mysql::csa::Transaction_conflict_manager::m_is_stopped {false}
private

Variable to gracefully stop the thread.

◆ m_scheduled_tasks

std::atomic<std::size_t> mysql::csa::Transaction_conflict_manager::m_scheduled_tasks {0}
private

The number of scheduled tasks.

◆ m_thread

Thread_type mysql::csa::Transaction_conflict_manager::m_thread
private

Decoder thread object.


The documentation for this class was generated from the following files: