mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
MDEV-35574 remove obsolete pthread_exit calls
Threads can normally exit without a explicit pthread_exit call.
There seem to date to old glibc bugs, many around 2.2.5.
The semi related bug was https://bugs.mysql.com/bug.php?id=82886.
To improve safety in the signal handlers DBUG_* code was removed.
These where also needed to avoid some MSAN unresolved stack issues.
This is effectively a backport of 2719cc4925
.
This commit is contained in:
parent
d92d271648
commit
bf7cfa2535
10 changed files with 4 additions and 22 deletions
|
@ -631,7 +631,6 @@ error:
|
|||
pthread_cond_signal(&count_threshhold);
|
||||
pthread_mutex_unlock(&counter_mutex);
|
||||
mysql_thread_end();
|
||||
pthread_exit(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -991,7 +991,6 @@ end_thread:
|
|||
cn->mysql= 0;
|
||||
cn->query_done= 1;
|
||||
mysql_thread_end();
|
||||
pthread_exit(0);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
|
|
|
@ -566,8 +566,7 @@ static void *alarm_handler(void *arg __attribute__((unused)))
|
|||
alarm_thread_running= 0;
|
||||
mysql_cond_signal(&COND_alarm);
|
||||
mysql_mutex_unlock(&LOCK_alarm);
|
||||
pthread_exit(0);
|
||||
return 0; /* Impossible */
|
||||
return 0;
|
||||
}
|
||||
#endif /* USE_ALARM_THREAD */
|
||||
#endif
|
||||
|
|
|
@ -330,8 +330,7 @@ static void *timer_handler(void *arg __attribute__((unused)))
|
|||
}
|
||||
mysql_mutex_unlock(&LOCK_timer);
|
||||
my_thread_end();
|
||||
pthread_exit(0);
|
||||
return 0; /* Impossible */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -290,7 +290,6 @@ pthread_handler_t background_thread(void *arg __attribute__((unused)))
|
|||
}
|
||||
|
||||
my_thread_end();
|
||||
pthread_exit(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -2948,7 +2948,6 @@ pthread_handler_t signal_hand(void *)
|
|||
sigset_t set;
|
||||
int sig;
|
||||
my_thread_init(); // Init new thread
|
||||
DBUG_ENTER("signal_hand");
|
||||
signal_thread_in_use= 1;
|
||||
|
||||
/*
|
||||
|
@ -3014,7 +3013,6 @@ pthread_handler_t signal_hand(void *)
|
|||
/* switch to the old log message processing */
|
||||
logger.set_handlers(global_system_variables.sql_log_slow ? LOG_FILE:LOG_NONE,
|
||||
opt_log ? LOG_FILE:LOG_NONE);
|
||||
DBUG_PRINT("info",("Got signal: %d abort_loop: %d",sig,abort_loop));
|
||||
|
||||
break_connect_loop();
|
||||
DBUG_ASSERT(abort_loop);
|
||||
|
@ -3050,12 +3048,9 @@ pthread_handler_t signal_hand(void *)
|
|||
break; /* purecov: tested */
|
||||
}
|
||||
}
|
||||
DBUG_PRINT("quit", ("signal_handler: calling my_thread_end()"));
|
||||
my_thread_end();
|
||||
DBUG_LEAVE; // Must match DBUG_ENTER()
|
||||
signal_thread_in_use= 0;
|
||||
pthread_exit(0); // Safety
|
||||
return(0); /* purecov: deadcode */
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static void check_data_home(const char *path)
|
||||
|
|
|
@ -271,12 +271,7 @@ error_exit_in_thread(intptr_t code)
|
|||
CRITICAL_SECTION_ENTER(grntest_cs);
|
||||
grntest_stop_flag = 1;
|
||||
CRITICAL_SECTION_LEAVE(grntest_cs);
|
||||
#ifdef WIN32
|
||||
_endthreadex(code);
|
||||
#else
|
||||
pthread_exit((void *)code);
|
||||
#endif /* WIN32 */
|
||||
return 0;
|
||||
return code;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -70,7 +70,6 @@ end:
|
|||
thread_count--;
|
||||
pthread_cond_signal(&COND_thread_count); /* Tell main we are ready */
|
||||
pthread_mutex_unlock(&LOCK_thread_count);
|
||||
pthread_exit(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -91,7 +91,6 @@ pthread_handler_t thread_stack_check(void *arg __attribute__((unused)))
|
|||
test_stack_detection(1, STACK_ALLOC_SMALL_BLOCK_SIZE-1);
|
||||
test_stack_detection(2, STACK_ALLOC_SMALL_BLOCK_SIZE+1);
|
||||
my_thread_end();
|
||||
pthread_exit(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -108,7 +108,6 @@ void *test_apc_service_thread(void *ptr)
|
|||
apc_target.destroy();
|
||||
mysql_mutex_destroy(&target_mutex);
|
||||
my_thread_end();
|
||||
pthread_exit(0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue