From: Willy Tarreau Date: Sun, 18 Oct 2020 09:05:23 +0000 (+0200) Subject: MINOR: threads: change lock_t to an unsigned int X-Git-Tag: v2.3-dev8~43 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8f1f177ed0bbdb6c10e61e83994df113452d434f;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/include/haproxy/thread-t.h b/include/haproxy/thread-t.h index e827361646..bac83aedb0 100644 --- a/include/haproxy/thread-t.h +++ b/include/haproxy/thread-t.h @@ -95,8 +95,8 @@ /*** Common parts below ***/ /* storage types used by spinlocks and RW locks */ -#define __HA_SPINLOCK_T unsigned long -#define __HA_RWLOCK_T unsigned long +#define __HA_SPINLOCK_T unsigned int +#define __HA_RWLOCK_T unsigned int /* When thread debugging is enabled, we remap HA_SPINLOCK_T and HA_RWLOCK_T to