MySQL 5.6.14 Source Code Document
|
Public Member Functions | |
Thread_excursion (THD *thd) | |
void | try_to_attach_to (THD *thd) |
Helper class to perform a thread excursion.
This class is used to temporarily switch to another session (THD structure). It will set up the PSI structures and other "globals" correctly (e.g., thread-specific variables) so that the POSIX thread looks exactly like the session attached to.
On destruction, the original session (which is supplied to the constructor) will be re-attached automatically. For example, with this code, the value of current_thd
will be the same before and after execution of the code.
|
inline |
Try to attach the POSIX thread to a session.
[in] | thd | The thd of a session |