summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_class.cc15
1 files changed, 14 insertions, 1 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index a904023cbff..368ed897a4d 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -818,7 +818,20 @@ void THD::awake(THD::killed_state state_to_set)
if (!slave_thread)
thread_scheduler.post_kill_notification(this);
#ifdef SIGNAL_WITH_VIO_CLOSE
- close_active_vio();
+ if (this != current_thd)
+ {
+ /*
+ In addition to a signal, let's close the socket of the thread that
+ is being killed. This is to make sure it does not block if the
+ signal is lost. This needs to be done only on platforms where
+ signals are not a reliable interruption mechanism.
+
+ If we're killing ourselves, we know that we're not blocked, so this
+ hack is not used.
+ */
+
+ close_active_vio();
+ }
#endif
}
if (mysys_var)