mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-28 14:21:00 +01:00
BUG/MINOR: threads: set threads_idle and threads_harmless even with no threads
Some signal handlers rely on these to decide about the level of detail to provide in dumps, so let's properly fill the info about entering/leaving idle. Note that for consistency with other tests we're using bitops with t->ltid_bit, while we could simply assign 0/1 to the fields. But it makes the code more readable and the whole difference is only 88 bytes on a 3MB executable. This bug is not important, and while older versions are likely affected as well, it's not worth taking the risk to backport this in case it would wake up an obscure bug.
This commit is contained in:
parent
f499fa3dcd
commit
337017e2f9
@ -110,27 +110,32 @@ static inline void ha_set_thread(const struct thread_info *thr)
|
||||
|
||||
static inline void thread_idle_now()
|
||||
{
|
||||
tg_ctx->threads_idle |= ti->ltid_bit;
|
||||
}
|
||||
|
||||
static inline void thread_idle_end()
|
||||
{
|
||||
tg_ctx->threads_idle &= ~ti->ltid_bit;
|
||||
}
|
||||
|
||||
static inline void thread_harmless_now()
|
||||
{
|
||||
tg_ctx->threads_harmless |= ti->ltid_bit;
|
||||
}
|
||||
|
||||
static inline int is_thread_harmless()
|
||||
{
|
||||
return 1;
|
||||
return !!(tg_ctx->threads_harmless & ti->ltid_bit);
|
||||
}
|
||||
|
||||
static inline void thread_harmless_end()
|
||||
{
|
||||
tg_ctx->threads_harmless &= ~ti->ltid_bit;
|
||||
}
|
||||
|
||||
static inline void thread_harmless_end_sig()
|
||||
{
|
||||
tg_ctx->threads_harmless &= ~ti->ltid_bit;
|
||||
}
|
||||
|
||||
static inline void thread_isolate()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user