| 2085 | */ |
| 2086 | extern std::atomic<my_thread_id> shutdown_thread_id; |
| 2087 | void 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. */ |
| 2135 | void THD::abort_current_cond_wait(bool force) |
no test coverage detected