1#ifndef DEBUG_SYNC_INCLUDED
2#define DEBUG_SYNC_INCLUDED
3
4/* Copyright (c) 2009, 2010, Oracle and/or its affiliates.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; version 2 of the License.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
18
19/**
20 @file
21
22 Declarations for the Debug Sync Facility. See debug_sync.cc for details.
23*/
24
25#ifdef USE_PRAGMA_INTERFACE
26#pragma interface /* gcc class implementation */
27#endif
28
29class THD;
30
31#if defined(ENABLED_DEBUG_SYNC)
32
33/* Command line option --debug-sync-timeout. See mysqld.cc. */
34extern MYSQL_PLUGIN_IMPORT uint opt_debug_sync_timeout;
35
36/* Default WAIT_FOR timeout if command line option is given without argument. */
37#define DEBUG_SYNC_DEFAULT_WAIT_TIMEOUT 300
38
39/* Debug Sync prototypes. See debug_sync.cc. */
40extern int debug_sync_init(void);
41extern void debug_sync_end(void);
42extern void debug_sync_init_thread(THD *thd);
43extern void debug_sync_end_thread(THD *thd);
44extern bool debug_sync_set_action(THD *thd, const char *action_str, size_t len);
45extern bool debug_sync_update(THD *thd, char *val_str, size_t len);
46extern uchar *debug_sync_value_ptr(THD *thd);
47
48#endif /* defined(ENABLED_DEBUG_SYNC) */
49
50#endif /* DEBUG_SYNC_INCLUDED */
51