~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/include/ut0dbg.h

Merged from jay.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
/*****************************************************************
25
25
Report a failed assertion. */
26
 
UNIV_INTERN
 
26
 
27
27
void
28
28
ut_dbg_assertion_failed(
29
29
/*====================*/
31
31
        const char* file,       /* in: source file containing the assertion */
32
32
        ulint line);            /* in: line number of the assertion */
33
33
 
34
 
#ifdef __NETWARE__
35
 
/* Flag for ignoring further assertion failures.
36
 
On NetWare, have a graceful exit rather than a segfault to avoid abends. */
37
 
extern ibool    panic_shutdown;
38
 
/* Abort the execution. */
39
 
void ut_dbg_panic(void);
40
 
# define UT_DBG_PANIC ut_dbg_panic()
41
 
/* Stop threads in ut_a(). */
42
 
# define UT_DBG_STOP    while (0)       /* We do not do this on NetWare */
43
 
#else /* __NETWARE__ */
44
34
# if defined(__WIN__) || defined(__INTEL_COMPILER)
45
35
#  undef UT_DBG_USE_ABORT
46
36
# elif defined(__GNUC__) && (__GNUC__ > 2)
59
49
 
60
50
/*****************************************************************
61
51
Stop a thread after assertion failure. */
62
 
UNIV_INTERN
 
52
 
63
53
void
64
54
ut_dbg_stop_thread(
65
55
/*===============*/
71
61
/* Abort the execution. */
72
62
#  define UT_DBG_PANIC abort()
73
63
/* Stop threads (null operation) */
74
 
#  define UT_DBG_STOP while (0) {}
 
64
#  define UT_DBG_STOP while (0)
75
65
# else /* UT_DBG_USE_ABORT */
76
66
/* Abort the execution. */
77
67
#  define UT_DBG_PANIC                                  \
82
72
                ut_dbg_stop_thread(__FILE__, (ulint) __LINE__); \
83
73
        } while (0)
84
74
# endif /* UT_DBG_USE_ABORT */
85
 
#endif /* __NETWARE__ */
86
75
 
87
76
/* Abort execution if EXPR does not evaluate to nonzero. */
88
77
#define ut_a(EXPR) do {                                         \
110
99
 
111
100
#define UT_NOT_USED(A)  A = A
112
101
 
113
 
#ifdef UNIV_COMPILE_TEST_FUNCS
114
 
 
115
 
#include <sys/types.h>
116
 
#include <sys/time.h>
117
 
#include <sys/resource.h>
118
 
 
119
 
/* structure used for recording usage statistics */
120
 
typedef struct speedo_struct {
121
 
        struct rusage   ru;
122
 
        struct timeval  tv;
123
 
} speedo_t;
124
 
 
125
 
/***********************************************************************
126
 
Resets a speedo (records the current time in it). */
127
 
UNIV_INTERN
128
 
void
129
 
speedo_reset(
130
 
/*=========*/
131
 
        speedo_t*       speedo);        /* out: speedo */
132
 
 
133
 
/***********************************************************************
134
 
Shows the time elapsed and usage statistics since the last reset of a
135
 
speedo. */
136
 
UNIV_INTERN
137
 
void
138
 
speedo_show(
139
 
/*========*/
140
 
        const speedo_t* speedo);        /* in: speedo */
141
 
 
142
 
#endif /* UNIV_COMPILE_TEST_FUNCS */
143
 
 
144
102
#endif