mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 06:11:32 +02:00
CLEANUP: debug: make use of ha_tkill() and remove ifdefs
This way we always signal the threads the same way.
This commit is contained in:
parent
2beaaf7d46
commit
fade80d162
15
src/debug.c
15
src/debug.c
@ -360,11 +360,9 @@ static int debug_parse_cli_tkill(char **args, char *payload, struct appctx *appc
|
|||||||
if (*args[4])
|
if (*args[4])
|
||||||
sig = atoi(args[4]);
|
sig = atoi(args[4]);
|
||||||
|
|
||||||
#if defined(USE_THREAD)
|
|
||||||
if (thr)
|
if (thr)
|
||||||
pthread_kill(thread_info[thr-1].pthread, sig);
|
ha_tkill(thr - 1, sig);
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
raise(sig);
|
raise(sig);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -406,7 +404,6 @@ struct buffer *thread_dump_buffer = NULL;
|
|||||||
|
|
||||||
void ha_thread_dump_all_to_trash()
|
void ha_thread_dump_all_to_trash()
|
||||||
{
|
{
|
||||||
__maybe_unused unsigned int thr;
|
|
||||||
unsigned long old;
|
unsigned long old;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
@ -418,15 +415,7 @@ void ha_thread_dump_all_to_trash()
|
|||||||
|
|
||||||
thread_dump_buffer = &trash;
|
thread_dump_buffer = &trash;
|
||||||
thread_dump_tid = tid;
|
thread_dump_tid = tid;
|
||||||
|
ha_tkillall(DEBUGSIG);
|
||||||
#ifdef USE_THREAD
|
|
||||||
for (thr = 0; thr < global.nbthread; thr++) {
|
|
||||||
if (thr != tid)
|
|
||||||
pthread_kill(thread_info[thr].pthread, DEBUGSIG);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
/* dump ourselves last */
|
|
||||||
raise(DEBUGSIG);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* handles DEBUGSIG to dump the state of the thread it's working on */
|
/* handles DEBUGSIG to dump the state of the thread it's working on */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user