mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Optimized code for setting user variables with := and fixed some bugs in old code (Bug #1194)
Use forced close of socket to make mysqld shutdown faster when used under valgrind
This commit is contained in:
@ -55,7 +55,9 @@
|
||||
char pstack_file_name[80];
|
||||
#endif /* __linux__ */
|
||||
|
||||
#if defined(HAVE_DEC_3_2_THREADS) || defined(SIGNALS_DONT_BREAK_READ)
|
||||
/* We have HAVE_purify below as this speeds up the shutdown of MySQL */
|
||||
|
||||
#if defined(HAVE_DEC_3_2_THREADS) || defined(SIGNALS_DONT_BREAK_READ) || defined(HAVE_purify) && defined(__linux__)
|
||||
#define HAVE_CLOSE_SERVER_SOCK 1
|
||||
#endif
|
||||
|
||||
@ -534,12 +536,14 @@ static void close_connections(void)
|
||||
struct timespec abstime;
|
||||
int error;
|
||||
LINT_INIT(error);
|
||||
DBUG_PRINT("info",("Waiting for select_thread"));
|
||||
|
||||
#ifndef DONT_USE_THR_ALARM
|
||||
if (pthread_kill(select_thread,THR_CLIENT_ALARM))
|
||||
break; // allready dead
|
||||
#endif
|
||||
set_timespec(abstime, 2);
|
||||
for (uint tmp=0 ; tmp < 10 ; tmp++)
|
||||
for (uint tmp=0 ; tmp < 10 && select_thread_in_use; tmp++)
|
||||
{
|
||||
error=pthread_cond_timedwait(&COND_thread_count,&LOCK_thread_count,
|
||||
&abstime);
|
||||
@ -700,8 +704,8 @@ static void close_server_sock()
|
||||
VOID(shutdown(tmp_sock,2));
|
||||
#if defined(__NETWARE__)
|
||||
/*
|
||||
The following code is disabled for normal systems as it causes MySQL
|
||||
AIX 4.3 during shutdown (not tested, but likely)
|
||||
The following code is disabled for normal systems as it may cause MySQL
|
||||
to hang on AIX 4.3 during shutdown
|
||||
*/
|
||||
DBUG_PRINT("info",("calling closesocket on unix/IP socket"));
|
||||
VOID(closesocket(tmp_sock));
|
||||
|
Reference in New Issue
Block a user