summaryrefslogtreecommitdiff
path: root/sql/debug_sync.cc
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2020-03-10 17:43:42 +0400
committerSergey Vojtovich <svoj@mariadb.org>2020-03-13 15:44:42 +0400
commit662d8a8638569c196a20e912fd8a8ab97e364a00 (patch)
tree8de141373cd8265d33c10641de01595e0a951482 /sql/debug_sync.cc
parentc58686447ff7eac2f480e8539da4f551ae0609ef (diff)
downloadmariadb-git-662d8a8638569c196a20e912fd8a8ab97e364a00.tar.gz
Extended debug_sync_control life time
It now lives from THD constructor to THD destructor. Reset before THD is released to a cache. Change user doesn't reset debug_sync_control anymore. Needed to be able to make use of DEBUG_SYNC() at later stages like ha_close_connection().
Diffstat (limited to 'sql/debug_sync.cc')
-rw-r--r--sql/debug_sync.cc20
1 files changed, 14 insertions, 6 deletions
diff --git a/sql/debug_sync.cc b/sql/debug_sync.cc
index fdca2c47dbc..2fc2e00d043 100644
--- a/sql/debug_sync.cc
+++ b/sql/debug_sync.cc
@@ -287,12 +287,6 @@ void debug_sync_end_thread(THD *thd)
{
st_debug_sync_control *ds_control= thd->debug_sync_control;
- /*
- This synchronization point can be used to synchronize on thread end.
- This is the latest point in a THD's life, where this can be done.
- */
- DEBUG_SYNC(thd, "thread_end");
-
if (ds_control->ds_action)
{
st_debug_sync_action *action= ds_control->ds_action;
@@ -322,6 +316,20 @@ void debug_sync_end_thread(THD *thd)
}
+void debug_sync_reset_thread(THD *thd)
+{
+ if (thd->debug_sync_control)
+ {
+ /*
+ This synchronization point can be used to synchronize on thread end.
+ This is the latest point in a THD's life, where this can be done.
+ */
+ DEBUG_SYNC(thd, "thread_end");
+ thd->debug_sync_control->ds_active= 0;
+ }
+}
+
+
/**
Move a string by length.