2009-09-29 17:38:40 +02:00
|
|
|
#ifndef DEBUG_SYNC_INCLUDED
|
|
|
|
#define DEBUG_SYNC_INCLUDED
|
|
|
|
|
2011-11-21 18:13:14 +01:00
|
|
|
/* Copyright (c) 2009, 2010, Oracle and/or its affiliates.
|
2009-09-29 17:38:40 +02:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; version 2 of the License.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
2019-05-11 20:29:06 +02:00
|
|
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
|
2009-09-29 17:38:40 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
@file
|
|
|
|
|
|
|
|
Declarations for the Debug Sync Facility. See debug_sync.cc for details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef USE_PRAGMA_INTERFACE
|
|
|
|
#pragma interface /* gcc class implementation */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
class THD;
|
|
|
|
|
|
|
|
#if defined(ENABLED_DEBUG_SYNC)
|
|
|
|
|
2013-07-02 19:43:35 +02:00
|
|
|
/* Command line option --debug-sync-timeout. See mysqld.cc. */
|
|
|
|
extern MYSQL_PLUGIN_IMPORT uint opt_debug_sync_timeout;
|
|
|
|
|
2009-09-29 17:38:40 +02:00
|
|
|
/* Default WAIT_FOR timeout if command line option is given without argument. */
|
|
|
|
#define DEBUG_SYNC_DEFAULT_WAIT_TIMEOUT 300
|
|
|
|
|
|
|
|
/* Debug Sync prototypes. See debug_sync.cc. */
|
|
|
|
extern int debug_sync_init(void);
|
|
|
|
extern void debug_sync_end(void);
|
|
|
|
extern void debug_sync_init_thread(THD *thd);
|
|
|
|
extern void debug_sync_end_thread(THD *thd);
|
2020-03-10 14:43:42 +01:00
|
|
|
void debug_sync_reset_thread(THD *thd);
|
2010-03-19 10:06:40 +01:00
|
|
|
extern bool debug_sync_set_action(THD *thd, const char *action_str, size_t len);
|
2016-05-17 13:27:10 +02:00
|
|
|
extern bool debug_sync_update(THD *thd, char *val_str, size_t len);
|
|
|
|
extern uchar *debug_sync_value_ptr(THD *thd);
|
2020-03-10 14:43:42 +01:00
|
|
|
#else
|
|
|
|
static inline void debug_sync_init_thread(THD *thd) {}
|
|
|
|
static inline void debug_sync_end_thread(THD *thd) {}
|
|
|
|
static inline void debug_sync_reset_thread(THD *thd) {}
|
2020-06-10 06:29:26 +02:00
|
|
|
static inline bool debug_sync_set_action(THD *, const char *, size_t)
|
|
|
|
{ return false; }
|
2009-09-29 17:38:40 +02:00
|
|
|
#endif /* defined(ENABLED_DEBUG_SYNC) */
|
|
|
|
|
|
|
|
#endif /* DEBUG_SYNC_INCLUDED */
|