MINOR: threads: change lock_t to an unsigned int
authorWilly Tarreau <w@1wt.eu>
Sun, 18 Oct 2020 09:05:23 +0000 (11:05 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 19 Oct 2020 12:08:13 +0000 (14:08 +0200)
commit8f1f177ed0bbdb6c10e61e83994df113452d434f
tree92c82de31b93f50cf28f682c5920f527019caa00
parent3d18498645308a068797b157f509fbabcb934c3f
MINOR: threads: change lock_t to an unsigned int

We don't need to waste the size of a long for the locks: with the plocks,
even an unsigned short would offer enough room for up to 126 threads! Let's
use an unsigned int which will be easier to place in certain structures
and will more conveniently plug some holes, and Atomic ops are at least
as fast on 32-bit as on 64-bit. This will not change anything for 32-bit
platforms.
include/haproxy/thread-t.h