24#ifndef MYSQL_CSA_TRANSACTION_CONFLICT_MANAGER_H
25#define MYSQL_CSA_TRANSACTION_CONFLICT_MANAGER_H
42class Transaction_conflict_manager;
44 std::unique_ptr<Transaction_conflict_manager>;
106 std::array<Transaction_conflict_manager_sptr, max_instances>;
Wrapper to mysql thread, which matches interface of std::thread.
Definition: thread_srv.h:46
Rescue task to rollback conflicting transaction.
Definition: rescue_task.h:39
Rescue thread for solving conflicts between transactions Main methods are:
Definition: transaction_conflict_manager.h:52
Queue_type m_cache
Queue into which decoder thread puts data jobs.
Definition: transaction_conflict_manager.h:79
std::atomic< bool > m_is_stopped
Variable to gracefully stop the thread.
Definition: transaction_conflict_manager.h:85
bool is_stopped() const
Checks if stop has been requested.
Definition: transaction_conflict_manager.cpp:43
void run_thread()
Function executed by m_thread.
Definition: transaction_conflict_manager.cpp:45
void start()
Starts asynchronous thread that decodes jobs from the stream.
Definition: transaction_conflict_manager.cpp:30
void enqueue(Rescue_task &&task)
Preempt this transaction.
Definition: transaction_conflict_manager.cpp:60
std::atomic< bool > m_end
Notification atomic for end of execution.
Definition: transaction_conflict_manager.h:83
bool is_error() const
Check if provider has an error.
Thread_type m_thread
Decoder thread object.
Definition: transaction_conflict_manager.h:81
void stop()
Stops asynchronous thread, notifies it and and waits for notification that thread has been stopped an...
Definition: transaction_conflict_manager.cpp:36
std::atomic< std::size_t > m_scheduled_tasks
The number of scheduled tasks.
Definition: transaction_conflict_manager.h:87
Singleton Transaction_conflict_manager for all of the registered "instances".
Definition: transaction_conflict_manager.h:93
Transaction_conflict_monitor()=default
static Instances_map m_instances
Definition: transaction_conflict_manager.h:107
static constexpr int max_instances
Definition: transaction_conflict_manager.h:103
static std::atomic< bool > m_ready
Definition: transaction_conflict_manager.h:109
static Transaction_conflict_manager_sptr & get(std::size_t instance_id)
Obtain Transaction_conflict_manager for unique instance id.
Definition: transaction_conflict_manager.cpp:76
static std::atomic< bool > m_init
Definition: transaction_conflict_manager.h:108
std::array< Transaction_conflict_manager_sptr, max_instances > Instances_map
Definition: transaction_conflict_manager.h:106
static void init()
This initialization function is called by "get" if needed.
Definition: transaction_conflict_manager.cpp:89
std::thread Thread
Definition: thread_stl.h:42
Definition: channel.cpp:28
std::unique_ptr< Transaction_conflict_manager > Transaction_conflict_manager_sptr
Definition: transaction_conflict_manager.h:44
static constexpr unsigned int max_instances
The maximum number of scheduler instances supported This value should be aligned with the 'MAX_CHANNE...
Definition: constants.h:34