![]() |
MySQL 26.7.0
Source Code Documentation
|
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... | |
Rescue thread for solving conflicts between transactions Main methods are:
|
private |
Thread type.
| void mysql::csa::Transaction_conflict_manager::enqueue | ( | Rescue_task && | task | ) |
Preempt this transaction.
| bool mysql::csa::Transaction_conflict_manager::is_error | ( | ) | const |
Check if provider has an error.
| bool mysql::csa::Transaction_conflict_manager::is_stopped | ( | ) | const |
Checks if stop has been requested.
|
private |
Function executed by m_thread.
| void mysql::csa::Transaction_conflict_manager::start | ( | ) |
Starts asynchronous thread that decodes jobs from the stream.
| 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.
|
private |
Queue into which decoder thread puts data jobs.
|
private |
Notification atomic for end of execution.
|
private |
Variable to gracefully stop the thread.
|
private |
The number of scheduled tasks.
|
private |
Decoder thread object.