Skip to content

Commit ebd2462

Browse files
author
Magne Mahre
committed
Remove configuration preprocessor symbols 'THREAD'
and 'THREAD_SAFE_CLIENT'. As of MySQL 5.5, we no longer support non-threaded builds. This patch removes all references to the obsolete THREAD and THREAD_SAFE_CLIENT preprocessor symbols. These were used to distinguish between threaded and non-threaded builds.
1 parent f6bcd9c commit ebd2462

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+94
-816
lines changed

client/mysqladmin.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -17,9 +17,7 @@
1717

1818
#include "client_priv.h"
1919
#include <signal.h>
20-
#ifdef THREAD
2120
#include <my_pthread.h> /* because of signal() */
22-
#endif
2321
#include <sys/stat.h>
2422
#include <mysql.h>
2523
#include <sql_common.h>

cmd-line-utils/readline/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
1717
${CMAKE_SOURCE_DIR}/cmd-line-utils)
1818

19-
ADD_DEFINITIONS(-DHAVE_CONFIG_H -DNO_KILL_INTR -DMYSQL_CLIENT_NO_THREADS)
19+
ADD_DEFINITIONS(-DHAVE_CONFIG_H -DNO_KILL_INTR)
2020

2121
INCLUDE_DIRECTORIES(${CURSES_INCLUDE_PATH})
2222

config.h.cmake

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
/* Copyright (C) 2009 Sun Microsystems, Inc
2-
1+
/* Copyright (C) 2009, 2011, Oracle and/or its affiliates. All rights
2+
reserved
3+
34
This program is free software; you can redistribute it and/or modify
45
it under the terms of the GNU General Public License as published by
56
the Free Software Foundation; version 2 of the License.
@@ -470,9 +471,6 @@
470471

471472
#cmakedefine STACK_DIRECTION @STACK_DIRECTION@
472473

473-
#define THREAD 1
474-
#define THREAD_SAFE_CLIENT 1
475-
476474
#define SYSTEM_TYPE "@SYSTEM_TYPE@"
477475
#define MACHINE_TYPE "@CMAKE_SYSTEM_PROCESSOR@"
478476
#cmakedefine HAVE_DTRACE 1

dbug/dbug.c

Lines changed: 2 additions & 229 deletions
Original file line numberDiff line numberDiff line change
@@ -319,15 +319,6 @@ static void DbugExit(const char *why);
319319
static const char *DbugStrTok(const char *s);
320320
static void DbugVfprintf(FILE *stream, const char* format, va_list args);
321321

322-
#ifndef THREAD
323-
/* Open profile output stream */
324-
static FILE *OpenProfile(CODE_STATE *cs, const char *name);
325-
/* Profile if asked for it */
326-
static BOOLEAN DoProfile(CODE_STATE *);
327-
/* Return current user time (ms) */
328-
static unsigned long Clock(void);
329-
#endif
330-
331322
/*
332323
* Miscellaneous printf format strings.
333324
*/
@@ -355,7 +346,6 @@ static unsigned long Clock(void);
355346
** Macros to allow dbugging with threads
356347
*/
357348

358-
#ifdef THREAD
359349
#include <my_pthread.h>
360350
static pthread_mutex_t THR_LOCK_dbug;
361351

@@ -394,30 +384,6 @@ static CODE_STATE *code_state(void)
394384
return cs;
395385
}
396386

397-
#else /* !THREAD */
398-
399-
static CODE_STATE static_code_state=
400-
{
401-
"dbug", "?func", "?file", NULL, &init_settings,
402-
NullS, NullS, 0,0,0,0,0,NullS
403-
};
404-
405-
static CODE_STATE *code_state(void)
406-
{
407-
if (!init_done)
408-
{
409-
bzero(&init_settings, sizeof(init_settings));
410-
init_settings.out_file=stderr;
411-
init_settings.flags=OPEN_APPEND;
412-
init_done=TRUE;
413-
}
414-
return &static_code_state;
415-
}
416-
417-
#define pthread_mutex_lock(A) {}
418-
#define pthread_mutex_unlock(A) {}
419-
#endif
420-
421387
/*
422388
* Translate some calls among different systems.
423389
*/
@@ -601,15 +567,6 @@ int DbugParse(CODE_STATE *cs, const char *control)
601567
else
602568
stack->flags |= PID_ON;
603569
break;
604-
#ifndef THREAD
605-
case 'g':
606-
if (OpenProfile(cs, PROF_FILE))
607-
{
608-
stack->flags |= PROFILE_ON;
609-
stack->p_functions= ListAdd(stack->p_functions, control, end);
610-
}
611-
break;
612-
#endif
613570
case 'L':
614571
if (sign < 0)
615572
stack->flags &= ~LINE_ON;
@@ -1154,23 +1111,7 @@ void _db_enter_(const char *_func_, const char *_file_,
11541111
_stack_frame_->prev= cs->framep;
11551112
_stack_frame_->level= ++cs->level | framep_trace_flag(cs, cs->framep);
11561113
cs->framep= _stack_frame_;
1157-
#ifndef THREAD
1158-
if (DoProfile(cs))
1159-
{
1160-
long stackused;
1161-
if (cs->framep->prev == NULL)
1162-
stackused= 0;
1163-
else
1164-
{
1165-
stackused= (char*)(cs->framep->prev) - (char*)(cs->framep);
1166-
stackused= stackused > 0 ? stackused : -stackused;
1167-
}
1168-
(void) fprintf(cs->stack->prof_file, PROF_EFMT , Clock(), cs->func);
1169-
(void) fprintf(cs->stack->prof_file, PROF_SFMT, (ulong) cs->framep, stackused,
1170-
AUTOS_REVERSE ? _stack_frame_->func : cs->func);
1171-
(void) fflush(cs->stack->prof_file);
1172-
}
1173-
#endif
1114+
11741115
switch (DoTrace(cs)) {
11751116
case ENABLE_TRACE:
11761117
cs->framep->level|= TRACE_ON;
@@ -1229,10 +1170,7 @@ void _db_return_(uint _line_, struct _db_stack_frame_ *_stack_frame_)
12291170
my_snprintf(buf, sizeof(buf), ERR_MISSING_RETURN, cs->func);
12301171
DbugExit(buf);
12311172
}
1232-
#ifndef THREAD
1233-
if (DoProfile(cs))
1234-
(void) fprintf(cs->stack->prof_file, PROF_XFMT, Clock(), cs->func);
1235-
#endif
1173+
12361174
if (DoTrace(cs) & DO_TRACE)
12371175
{
12381176
if (TRACING)
@@ -1744,36 +1682,6 @@ static int DoTrace(CODE_STATE *cs)
17441682
return DONT_TRACE;
17451683
}
17461684

1747-
1748-
/*
1749-
* FUNCTION
1750-
*
1751-
* DoProfile check to see if profiling is current enabled
1752-
*
1753-
* SYNOPSIS
1754-
*
1755-
* static BOOLEAN DoProfile()
1756-
*
1757-
* DESCRIPTION
1758-
*
1759-
* Checks to see if profiling is enabled based on whether the
1760-
* user has specified profiling, the maximum trace depth has
1761-
* not yet been reached, the current function is selected,
1762-
* and the current process is selected. Returns TRUE if
1763-
* profiling is enabled, FALSE otherwise.
1764-
*
1765-
*/
1766-
1767-
#ifndef THREAD
1768-
static BOOLEAN DoProfile(CODE_STATE *cs)
1769-
{
1770-
return PROFILING &&
1771-
cs->level <= cs->stack->maxdepth &&
1772-
InList(cs->stack->p_functions, cs->func) & (INCLUDE|MATCHED) &&
1773-
InList(cs->stack->processes, cs->process) & (INCLUDE|MATCHED);
1774-
}
1775-
#endif
1776-
17771685
FILE *_db_fp_(void)
17781686
{
17791687
CODE_STATE *cs;
@@ -1900,11 +1808,7 @@ static void DoPrefix(CODE_STATE *cs, uint _line_)
19001808
cs->lineno++;
19011809
if (cs->stack->flags & PID_ON)
19021810
{
1903-
#ifdef THREAD
19041811
(void) fprintf(cs->stack->out_file, "%-7s: ", my_thread_name());
1905-
#else
1906-
(void) fprintf(cs->stack->out_file, "%5d: ", (int) getpid());
1907-
#endif
19081812
}
19091813
if (cs->stack->flags & NUMBER_ON)
19101814
(void) fprintf(cs->stack->out_file, "%5d: ", cs->lineno);
@@ -2014,63 +1918,6 @@ static void DBUGOpenFile(CODE_STATE *cs,
20141918
}
20151919
}
20161920

2017-
2018-
/*
2019-
* FUNCTION
2020-
*
2021-
* OpenProfile open new output stream for profiler output
2022-
*
2023-
* SYNOPSIS
2024-
*
2025-
* static FILE *OpenProfile(name)
2026-
* char *name;
2027-
*
2028-
* DESCRIPTION
2029-
*
2030-
* Given name of a new file, opens the file
2031-
* and sets the profiler output stream to the new file.
2032-
*
2033-
* It is currently unclear whether the prefered behavior is
2034-
* to truncate any existing file, or simply append to it.
2035-
* The latter behavior would be desirable for collecting
2036-
* accumulated runtime history over a number of separate
2037-
* runs. It might take some changes to the analyzer program
2038-
* though, and the notes that Binayak sent with the profiling
2039-
* diffs indicated that append was the normal mode, but this
2040-
* does not appear to agree with the actual code. I haven't
2041-
* investigated at this time [fnf; 24-Jul-87].
2042-
*/
2043-
2044-
#ifndef THREAD
2045-
static FILE *OpenProfile(CODE_STATE *cs, const char *name)
2046-
{
2047-
REGISTER FILE *fp;
2048-
REGISTER BOOLEAN newfile;
2049-
2050-
fp=0;
2051-
if (!Writable(name))
2052-
{
2053-
(void) fprintf(cs->stack->out_file, ERR_OPEN, cs->process, name);
2054-
perror("");
2055-
(void) Delay(cs->stack->delay);
2056-
}
2057-
else
2058-
{
2059-
newfile= !EXISTS(name);
2060-
if (!(fp= fopen(name, "w")))
2061-
{
2062-
(void) fprintf(cs->stack->out_file, ERR_OPEN, cs->process, name);
2063-
perror("");
2064-
}
2065-
else
2066-
{
2067-
cs->stack->prof_file= fp;
2068-
}
2069-
}
2070-
return fp;
2071-
}
2072-
#endif
2073-
20741921
/*
20751922
* FUNCTION
20761923
*
@@ -2419,80 +2266,6 @@ const char* _db_get_func_(void)
24192266
return cs->func;
24202267
}
24212268

2422-
/*
2423-
* Here we need the definitions of the clock routine. Add your
2424-
* own for whatever system that you have.
2425-
*/
2426-
2427-
#ifndef THREAD
2428-
#if defined(HAVE_GETRUSAGE)
2429-
2430-
#include <sys/param.h>
2431-
#include <sys/resource.h>
2432-
2433-
/* extern int getrusage(int, struct rusage *); */
2434-
2435-
/*
2436-
* Returns the user time in milliseconds used by this process so
2437-
* far.
2438-
*/
2439-
2440-
static unsigned long Clock()
2441-
{
2442-
struct rusage ru;
2443-
2444-
(void) getrusage(RUSAGE_SELF, &ru);
2445-
return ru.ru_utime.tv_sec*1000 + ru.ru_utime.tv_usec/1000;
2446-
}
2447-
2448-
#elif defined(__WIN__)
2449-
2450-
static ulong Clock()
2451-
{
2452-
return clock()*(1000/CLOCKS_PER_SEC);
2453-
}
2454-
#elif defined(amiga)
2455-
2456-
struct DateStamp { /* Yes, this is a hack, but doing it right */
2457-
long ds_Days; /* is incredibly ugly without splitting this */
2458-
long ds_Minute; /* off into a separate file */
2459-
long ds_Tick;
2460-
};
2461-
2462-
static int first_clock= TRUE;
2463-
static struct DateStamp begin;
2464-
static struct DateStamp elapsed;
2465-
2466-
static unsigned long Clock()
2467-
{
2468-
register struct DateStamp *now;
2469-
register unsigned long millisec= 0;
2470-
extern VOID *AllocMem();
2471-
2472-
now= (struct DateStamp *) AllocMem((long) sizeof(struct DateStamp), 0L);
2473-
if (now != NULL)
2474-
{
2475-
if (first_clock == TRUE)
2476-
{
2477-
first_clock= FALSE;
2478-
(void) DateStamp(now);
2479-
begin= *now;
2480-
}
2481-
(void) DateStamp(now);
2482-
millisec= 24 * 3600 * (1000 / HZ) * (now->ds_Days - begin.ds_Days);
2483-
millisec += 60 * (1000 / HZ) * (now->ds_Minute - begin.ds_Minute);
2484-
millisec += (1000 / HZ) * (now->ds_Tick - begin.ds_Tick);
2485-
(void) FreeMem(now, (long) sizeof(struct DateStamp));
2486-
}
2487-
return millisec;
2488-
}
2489-
#else
2490-
static unsigned long Clock()
2491-
{
2492-
return 0;
2493-
}
2494-
#endif /* RUSAGE */
2495-
#endif /* THREADS */
24962269

24972270
#else
24982271

dbug/dbug_analyze.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -571,12 +571,10 @@ int main (int argc, char **argv)
571571
FILE *infile;
572572
FILE *outfile = {stdout};
573573

574-
#ifdef THREAD
575574
#if defined(HAVE_PTHREAD_INIT)
576575
pthread_init(); /* Must be called before DBUG_ENTER */
577576
#endif
578-
my_thread_global_init();
579-
#endif /* THREAD */
577+
my_thread_global_init();
580578
{
581579
DBUG_ENTER ("main");
582580
DBUG_PROCESS (argv[0]);

dbug/my_main.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@ char *argv[];
1616
{
1717
register int result, ix;
1818
extern int factorial(int);
19-
#if defined(HAVE_PTHREAD_INIT) && defined(THREAD)
19+
#if defined(HAVE_PTHREAD_INIT)
2020
pthread_init(); /* Must be called before DBUG_ENTER */
2121
#endif
22-
#ifdef THREAD
2322
my_thread_global_init();
24-
#endif
23+
2524
{
2625
DBUG_ENTER ("main");
2726
DBUG_PROCESS (argv[0]);

dbug/tests.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,11 @@ int main (int argc, char *argv[])
4444
if (argc == 1)
4545
return 0;
4646

47-
#if defined(HAVE_PTHREAD_INIT) && defined(THREAD)
47+
#if defined(HAVE_PTHREAD_INIT)
4848
pthread_init(); /* Must be called before DBUG_ENTER */
4949
#endif
50-
#ifdef THREAD
5150
my_thread_global_init();
52-
#endif
51+
5352
dup2(1, 2);
5453
for (i = 1; i < argc; i++)
5554
{

include/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ SET(HEADERS
4040
my_xml.h
4141
mysql_embed.h
4242
my_pthread.h
43-
my_no_pthread.h
4443
decimal.h
4544
errmsg.h
4645
my_global.h

0 commit comments

Comments
 (0)