MCPcopy Create free account
hub / github.com/MariaDB/server / thread_state_info

Function thread_state_info

sql/sql_show.cc:2914–2943  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2912};
2913
2914static const char *thread_state_info(THD *tmp)
2915{
2916#ifndef EMBEDDED_LIBRARY
2917 if (tmp->net.reading_or_writing)
2918 {
2919 if (tmp->net.reading_or_writing == 2)
2920 return "Writing to net";
2921 if (tmp->get_command() == COM_SLEEP)
2922 return "";
2923 return "Reading from net";
2924 }
2925#else
2926 if (tmp->get_command() == COM_SLEEP)
2927 return "";
2928#endif
2929
2930 if (tmp->proc_info)
2931 return tmp->proc_info;
2932
2933 /* Check if we are waiting on a condition */
2934 if (!trylock_short(&tmp->LOCK_thd_kill))
2935 {
2936 /* mysys_var is protected by above mutex */
2937 bool cond= tmp->mysys_var && tmp->mysys_var->current_cond;
2938 mysql_mutex_unlock(&tmp->LOCK_thd_kill);
2939 if (cond)
2940 return "Waiting on cond";
2941 }
2942 return "";
2943}
2944
2945
2946/*

Callers 3

list_callbackFunction · 0.85
processlist_callbackFunction · 0.85

Calls 2

trylock_shortFunction · 0.85
get_commandMethod · 0.80

Tested by

no test coverage detected