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

Method awake_no_mutex

sql/sql_class.cc:2087–2132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2085*/
2086extern std::atomic<my_thread_id> shutdown_thread_id;
2087void THD::awake_no_mutex(killed_state state_to_set,
2088 int killed_errno_arg,
2089 const char *killed_err_msg_arg)
2090{
2091 DBUG_ENTER("THD::awake_no_mutex");
2092 DBUG_PRINT("enter", ("this: %p current_thd: %p state: %d",
2093 this, current_thd, (int) state_to_set));
2094 THD_CHECK_SENTRY(this);
2095 mysql_mutex_assert_owner(&LOCK_thd_data);
2096 mysql_mutex_assert_owner(&LOCK_thd_kill);
2097
2098 print_aborted_warning(3, "KILLED");
2099
2100 /*
2101 Don't degrade killed state, for example from a KILL_CONNECTION to
2102 STATEMENT TIMEOUT
2103 */
2104 if (killed >= KILL_CONNECTION)
2105 state_to_set= killed;
2106
2107 set_killed_no_mutex(state_to_set, killed_errno_arg, killed_err_msg_arg);
2108
2109 if (state_to_set >= KILL_CONNECTION || state_to_set == NOT_KILLED)
2110 {
2111#ifdef SIGNAL_WITH_VIO_CLOSE
2112 if (this != current_thd && thread_id != shutdown_thread_id)
2113 {
2114 if(active_vio)
2115 vio_shutdown(active_vio, SHUT_RDWR);
2116 }
2117#endif
2118
2119 /* Send an event to the scheduler that a thread should be killed. */
2120 if (!slave_thread)
2121 MYSQL_CALLBACK(scheduler, post_kill_notification, (this));
2122 }
2123
2124 /* Interrupt target waiting inside a storage engine. */
2125 if (state_to_set != NOT_KILLED &&
2126 IF_WSREP(!wsrep_is_bf_aborted(this) && wsrep_abort_by_kill == NOT_KILLED,
2127 true))
2128 ha_kill_query(this, thd_kill_level(this));
2129
2130 abort_current_cond_wait(false);
2131 DBUG_VOID_RETURN;
2132}
2133
2134/* Broadcast a condition to kick the target if it is waiting on it. */
2135void THD::abort_current_cond_wait(bool force)

Callers 9

wsrep_thd_bf_abortFunction · 0.80
kill_callback_collectFunction · 0.80
wsrep_abort_grantedFunction · 0.80
terminate_slave_threadFunction · 0.80
kill_one_threadFunction · 0.80
kill_threads_callbackFunction · 0.80
wsrep_abort_thdFunction · 0.80
wsrep_bf_abortFunction · 0.80
wsrep_kill_thdFunction · 0.80

Calls 3

wsrep_is_bf_abortedFunction · 0.85
ha_kill_queryFunction · 0.85
thd_kill_levelFunction · 0.85

Tested by

no test coverage detected