MySQL 9.1.0
Source Code Documentation
Session_plugin_thread Class Reference

#include <sql_service_command.h>

Public Member Functions

 Session_plugin_thread (Sql_service_commands *command_interface)
 
 ~Session_plugin_thread ()
 
int launch_session_thread (void *plugin_pointer_var, const char *user)
 Launch a new thread that will create a new server session. More...
 
int terminate_session_thread ()
 Terminate the thread and close the session. More...
 
int session_thread_handler ()
 Thread handler for session creation. More...
 
void queue_new_method_for_application (long(Sql_service_commands::*method)(Sql_service_interface *, void *), bool terminate=false)
 Method to submit a new method into execution on the session thread. More...
 
long wait_for_method_execution ()
 Wait for the queued method to return. More...
 
Sql_service_interfaceget_service_interface ()
 
void set_return_pointer (void *pointer)
 Sets a pointer that the next queued method will use to return a value. More...
 

Private Attributes

Sql_service_commandscommand_interface
 
Sql_service_interfacem_server_interface
 
Synchronized_queue< st_session_method * > * incoming_methods
 
void * m_plugin_pointer
 
void * return_object
 The value for returning on methods. More...
 
my_thread_handle m_plugin_session_pthd
 Session thread handle. More...
 
mysql_mutex_t m_run_lock
 
mysql_cond_t m_run_cond
 
mysql_mutex_t m_method_lock
 
mysql_cond_t m_method_cond
 
const char * session_user
 The user for the session connection. More...
 
bool m_method_execution_completed
 Session thread method completion flag. More...
 
long m_method_execution_return_value
 The method return value. More...
 
thread_state m_session_thread_state
 Session thread state. More...
 
bool m_session_thread_terminate
 Session termination flag. More...
 
int m_session_thread_error
 Session thread error flag. More...
 

Constructor & Destructor Documentation

◆ Session_plugin_thread()

Session_plugin_thread::Session_plugin_thread ( Sql_service_commands command_interface)

◆ ~Session_plugin_thread()

Session_plugin_thread::~Session_plugin_thread ( )

Member Function Documentation

◆ get_service_interface()

Sql_service_interface * Session_plugin_thread::get_service_interface ( )

◆ launch_session_thread()

int Session_plugin_thread::launch_session_thread ( void *  plugin_pointer_var,
const char *  user 
)

Launch a new thread that will create a new server session.

Parameters
plugin_pointer_varthe plugin pointer for session creation
userthe user for the connection
Returns
the operation was successful
Return values
0OK
!=0Error

◆ queue_new_method_for_application()

void Session_plugin_thread::queue_new_method_for_application ( long(Sql_service_commands::*)(Sql_service_interface *, void *)  method,
bool  terminate = false 
)

Method to submit a new method into execution on the session thread.

Parameters
methodmethod to executed
terminatetermination flag to the class

◆ session_thread_handler()

int Session_plugin_thread::session_thread_handler ( )

Thread handler for session creation.

◆ set_return_pointer()

void Session_plugin_thread::set_return_pointer ( void *  pointer)
inline

Sets a pointer that the next queued method will use to return a value.

Parameters
pointerthe pointer where the method will store some return value

◆ terminate_session_thread()

int Session_plugin_thread::terminate_session_thread ( )

Terminate the thread and close the session.

Returns
the operation was successful
Return values
0OK
!=0Error

◆ wait_for_method_execution()

long Session_plugin_thread::wait_for_method_execution ( )

Wait for the queued method to return.

Returns
the return value of the submitted method

Member Data Documentation

◆ command_interface

Sql_service_commands* Session_plugin_thread::command_interface
private

◆ incoming_methods

Synchronized_queue<st_session_method *>* Session_plugin_thread::incoming_methods
private

◆ m_method_cond

mysql_cond_t Session_plugin_thread::m_method_cond
private

◆ m_method_execution_completed

bool Session_plugin_thread::m_method_execution_completed
private

Session thread method completion flag.

◆ m_method_execution_return_value

long Session_plugin_thread::m_method_execution_return_value
private

The method return value.

◆ m_method_lock

mysql_mutex_t Session_plugin_thread::m_method_lock
private

◆ m_plugin_pointer

void* Session_plugin_thread::m_plugin_pointer
private

◆ m_plugin_session_pthd

my_thread_handle Session_plugin_thread::m_plugin_session_pthd
private

Session thread handle.

◆ m_run_cond

mysql_cond_t Session_plugin_thread::m_run_cond
private

◆ m_run_lock

mysql_mutex_t Session_plugin_thread::m_run_lock
private

◆ m_server_interface

Sql_service_interface* Session_plugin_thread::m_server_interface
private

◆ m_session_thread_error

int Session_plugin_thread::m_session_thread_error
private

Session thread error flag.

◆ m_session_thread_state

thread_state Session_plugin_thread::m_session_thread_state
private

Session thread state.

◆ m_session_thread_terminate

bool Session_plugin_thread::m_session_thread_terminate
private

Session termination flag.

◆ return_object

void* Session_plugin_thread::return_object
private

The value for returning on methods.

◆ session_user

const char* Session_plugin_thread::session_user
private

The user for the session connection.


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