![]() |
MySQL 26.7.0
Source Code Documentation
|
Wraps up THD object and provides simple function to manage its execution within CSA. More...
#include <session.h>
Public Member Functions | |
| Session (THD *parent_thd, std::size_t seq_num) | |
| Construct from configuration in parent_thd. More... | |
| virtual | ~Session () |
| Destructor. More... | |
| bool | is_valid () const |
| Checks if created session is valid True when session is valid, false otherwise. More... | |
| unsigned int | get_thd_id () const |
| Obtains handled THD identifier. More... | |
| THD * | get_thd () |
| Obtains THD handle. More... | |
| ulonglong | get_thread_id () const |
| Obtains thread identifier. More... | |
| void | awake (bool force_kill) |
| Awakes the handled session. More... | |
| void | attach (TABLE *temporary_tables) |
| Attach current thread to session. More... | |
| void | detach () |
| Detach current thread from session. More... | |
| bool | self_killed () const |
| Check if CSA killed this session. More... | |
| bool | is_killed () const |
Protected Attributes | |
| THD * | m_thd |
| The base server session associated with this processor. More... | |
| ulonglong | m_psi_id {0} |
| PSI thread id. More... | |
| const char * | m_saved_thread_stack {""} |
| Saved THD stack. More... | |
| long | m_stack_ptr {0} |
| Saved stack pointer. More... | |
| bool | m_is_valid {false} |
| Validity flag. More... | |
| bool | m_is_attached {false} |
| Attach flag. More... | |
| bool | m_is_killed {false} |
| We save our own kill flag and protect modifications with LOCK_thd_data. More... | |
| concurrency::Spin_lock_mutex | m_session_lock |
| Session lock for protecting attach/detach operations. More... | |
Wraps up THD object and provides simple function to manage its execution within CSA.
| mysql::csa::Session::Session | ( | THD * | parent_thd, |
| std::size_t | seq_num | ||
| ) |
Construct from configuration in parent_thd.
| parent_thd | Configuration THD |
| seq_num | Session sequence number |
|
virtual |
Destructor.
| void mysql::csa::Session::attach | ( | TABLE * | temporary_tables | ) |
Attach current thread to session.
Must succeed.
| temporary_tables | Temporary tables we attach |
| void mysql::csa::Session::awake | ( | bool | force_kill | ) |
Awakes the handled session.
| force_kill | If true, kills session |
| void mysql::csa::Session::detach | ( | ) |
Detach current thread from session.
| THD * mysql::csa::Session::get_thd | ( | ) |
Obtains THD handle.
| unsigned int mysql::csa::Session::get_thd_id | ( | ) | const |
Obtains handled THD identifier.
| ulonglong mysql::csa::Session::get_thread_id | ( | ) | const |
Obtains thread identifier.
|
inline |
| bool mysql::csa::Session::is_valid | ( | void | ) | const |
Checks if created session is valid True when session is valid, false otherwise.
|
inline |
Check if CSA killed this session.
|
protected |
Attach flag.
|
protected |
We save our own kill flag and protect modifications with LOCK_thd_data.
|
protected |
Validity flag.
|
protected |
PSI thread id.
|
protected |
Saved THD stack.
|
protected |
Session lock for protecting attach/detach operations.
While LOCK_thd_data could be used, in a large session pool we avoid its potential syscalls by using a spinlock instead.
|
protected |
Saved stack pointer.
|
protected |
The base server session associated with this processor.