MEDIUM: threads: replace ha_set_tid() with ha_set_thread()
authorWilly Tarreau <w@1wt.eu>
Tue, 28 Sep 2021 07:43:11 +0000 (09:43 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 8 Oct 2021 15:22:26 +0000 (17:22 +0200)
commit43ab05b3da3d1ec87b080903545d3f5eec1c96d0
tree87c49ba52f1f44c7e673ce3e8dcb18cef27932ba
parentcc7a11ee3b0d7663be874d1f3177ea8c54c3a5be
MEDIUM: threads: replace ha_set_tid() with ha_set_thread()

ha_set_tid() was randomly used either to explicitly set thread 0 or to
set any possibly incomplete thread during boot. Let's replace it with
a pointer to a valid thread or NULL for any thread. This allows us to
check that the designated threads are always valid, and to ignore the
thread 0's mapping when setting it to NULL, and always use group 0 with
it during boot.

The initialization code is also cleaner, as we don't pass ugly casts
of a thread ID to a pointer anymore.
include/haproxy/thread.h
src/haproxy.c
src/hlua.c
src/thread.c