Skip to content

Commit 81a73b8

Browse files
author
prabakaran thirumalai
committed
Bug#16293702 REMOVE DEAD CODE DEFINED WITH SIGNALS_DONT_BREAK_READ
Description: Removed code defined under SIGNALS_DONT_BREAK_READ compile time macro
1 parent 2c9cdea commit 81a73b8

File tree

1 file changed

+2
-49
lines changed

1 file changed

+2
-49
lines changed

sql/mysqld.cc

+2-49
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ using std::vector;
127127

128128
/* We have HAVE_purify below as this speeds up the shutdown of MySQL */
129129

130-
#if defined(HAVE_DEC_3_2_THREADS) || defined(SIGNALS_DONT_BREAK_READ) || defined(HAVE_purify) && defined(__linux__)
130+
#if defined(HAVE_DEC_3_2_THREADS) || defined(HAVE_purify) && defined(__linux__)
131131
#define HAVE_CLOSE_SERVER_SOCK 1
132132
#endif
133133

@@ -1512,11 +1512,6 @@ void kill_mysql(void)
15121512
{
15131513
DBUG_ENTER("kill_mysql");
15141514

1515-
#if defined(SIGNALS_DONT_BREAK_READ) && !defined(EMBEDDED_LIBRARY)
1516-
abort_loop=1; // Break connection loops
1517-
close_server_sock(); // Force accept to wake up
1518-
#endif
1519-
15201515
#if defined(__WIN__)
15211516
#if !defined(EMBEDDED_LIBRARY)
15221517
{
@@ -1537,22 +1532,11 @@ void kill_mysql(void)
15371532
{
15381533
DBUG_PRINT("error",("Got error %d from pthread_kill",errno)); /* purecov: inspected */
15391534
}
1540-
#elif !defined(SIGNALS_DONT_BREAK_READ)
1535+
#else
15411536
kill(current_pid, MYSQL_KILL_SIGNAL);
15421537
#endif
15431538
DBUG_PRINT("quit",("After pthread_kill"));
15441539
shutdown_in_progress=1; // Safety if kill didn't work
1545-
#ifdef SIGNALS_DONT_BREAK_READ
1546-
if (!kill_in_progress)
1547-
{
1548-
pthread_t tmp;
1549-
abort_loop=1;
1550-
if (mysql_thread_create(0, /* Not instrumented */
1551-
&tmp, &connection_attrib, kill_server_thread,
1552-
(void*) 0))
1553-
sql_print_error("Can't create thread to kill server");
1554-
}
1555-
#endif
15561540
DBUG_VOID_RETURN;
15571541
}
15581542

@@ -1676,22 +1660,14 @@ static void clean_up_error_log_mutex()
16761660
/**
16771661
cleanup all memory and end program nicely.
16781662
1679-
If SIGNALS_DONT_BREAK_READ is defined, this function is called
1680-
by the main thread. To get MySQL to shut down nicely in this case
1681-
(Mac OS X) we have to call exit() instead if pthread_exit().
1682-
16831663
@note
16841664
This function never returns.
16851665
*/
16861666
void unireg_end(void)
16871667
{
16881668
clean_up(1);
16891669
my_thread_end();
1690-
#if defined(SIGNALS_DONT_BREAK_READ)
1691-
exit(0);
1692-
#else
16931670
pthread_exit(0); // Exit is in main thread
1694-
#endif
16951671
}
16961672

16971673

@@ -6096,24 +6072,6 @@ static void create_new_thread(THD *thd)
60966072
}
60976073
#endif /* EMBEDDED_LIBRARY */
60986074

6099-
6100-
#ifdef SIGNALS_DONT_BREAK_READ
6101-
inline void kill_broken_server()
6102-
{
6103-
/* hack to get around signals ignored in syscalls for problem OS's */
6104-
if (mysql_get_fd(unix_sock) == INVALID_SOCKET ||
6105-
(!opt_disable_networking && mysql_socket_getfd(ip_sock) == INVALID_SOCKET))
6106-
{
6107-
select_thread_in_use = 0;
6108-
/* The following call will never return */
6109-
kill_server((void*) MYSQL_KILL_SIGNAL);
6110-
}
6111-
}
6112-
#define MAYBE_BROKEN_SYSCALL kill_broken_server();
6113-
#else
6114-
#define MAYBE_BROKEN_SYSCALL
6115-
#endif
6116-
61176075
/* Handle new connections and spawn new process to handle them */
61186076

61196077
#ifndef EMBEDDED_LIBRARY
@@ -6176,7 +6134,6 @@ void handle_connections_sockets()
61766134
#endif
61776135

61786136
DBUG_PRINT("general",("Waiting for connections."));
6179-
MAYBE_BROKEN_SYSCALL;
61806137
while (!abort_loop)
61816138
{
61826139
#ifdef HAVE_POLL
@@ -6200,13 +6157,11 @@ void handle_connections_sockets()
62006157
if (!select_errors++ && !abort_loop) /* purecov: inspected */
62016158
sql_print_error("mysqld: Got error %d from select",socket_errno); /* purecov: inspected */
62026159
}
6203-
MAYBE_BROKEN_SYSCALL
62046160
continue;
62056161
}
62066162

62076163
if (abort_loop)
62086164
{
6209-
MAYBE_BROKEN_SYSCALL;
62106165
break;
62116166
}
62126167

@@ -6258,7 +6213,6 @@ void handle_connections_sockets()
62586213
if (mysql_socket_getfd(new_sock) != INVALID_SOCKET ||
62596214
(socket_errno != SOCKET_EINTR && socket_errno != SOCKET_EAGAIN))
62606215
break;
6261-
MAYBE_BROKEN_SYSCALL;
62626216
#if !defined(NO_FCNTL_NONBLOCK)
62636217
if (!(test_flags & TEST_BLOCKING))
62646218
{
@@ -6281,7 +6235,6 @@ void handle_connections_sockets()
62816235
statistic_increment_rwlock(connection_errors_accept, &LOCK_status);
62826236
if ((error_count++ & 255) == 0) // This can happen often
62836237
sql_perror("Error in accept");
6284-
MAYBE_BROKEN_SYSCALL;
62856238
if (socket_errno == SOCKET_ENFILE || socket_errno == SOCKET_EMFILE)
62866239
sleep(1); // Give other threads some time
62876240
continue;

0 commit comments

Comments
 (0)