MWL#182: Explain running statements: address review feedback
- Make THD::check_killed() an inline function which makes calls to non-inline functions only whern there are APC requests to be served.
This commit is contained in:
parent
725d76e1e8
commit
f913ba7a60
@ -53,6 +53,15 @@ public:
|
|||||||
void disable();
|
void disable();
|
||||||
|
|
||||||
void process_apc_requests();
|
void process_apc_requests();
|
||||||
|
/*
|
||||||
|
A lightweight function, intended to be used in frequent checks like this:
|
||||||
|
|
||||||
|
if (apc_target.have_requests()) apc_target.process_apc_requests()
|
||||||
|
*/
|
||||||
|
inline bool have_apc_requests()
|
||||||
|
{
|
||||||
|
return test(apc_calls);
|
||||||
|
}
|
||||||
|
|
||||||
/* Functor class for calls you can schedule */
|
/* Functor class for calls you can schedule */
|
||||||
class Apc_call
|
class Apc_call
|
||||||
|
@ -2166,21 +2166,6 @@ void THD::rollback_item_tree_changes()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
Check if the thread has been killed, and also process "APC requests"
|
|
||||||
|
|
||||||
@retval true The thread is killed, execution should be interrupted
|
|
||||||
@retval false Not killed, continue execution
|
|
||||||
*/
|
|
||||||
|
|
||||||
bool THD::check_killed()
|
|
||||||
{
|
|
||||||
if (killed)
|
|
||||||
return TRUE;
|
|
||||||
apc_target.process_apc_requests();
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
** Functions to provide a interface to select results
|
** Functions to provide a interface to select results
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
@ -2222,7 +2222,14 @@ public:
|
|||||||
*/
|
*/
|
||||||
killed_state volatile killed;
|
killed_state volatile killed;
|
||||||
|
|
||||||
bool check_killed();
|
inline bool check_killed()
|
||||||
|
{
|
||||||
|
if (killed)
|
||||||
|
return TRUE;
|
||||||
|
if (apc_target.have_apc_requests())
|
||||||
|
apc_target.process_apc_requests();
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/* scramble - random string sent to client on handshake */
|
/* scramble - random string sent to client on handshake */
|
||||||
char scramble[SCRAMBLE_LENGTH+1];
|
char scramble[SCRAMBLE_LENGTH+1];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user