MINOR: backend: replace the lbprm lock with an rwlock
authorWilly Tarreau <w@1wt.eu>
Sat, 17 Oct 2020 16:48:47 +0000 (18:48 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 17 Oct 2020 16:51:41 +0000 (18:51 +0200)
commitcd10def825119900cfd5d87f6a48e5282679e95a
treefb80dc46a5695efd3b077bd84591a1cf69a1a98b
parent9d58c9b2517dff5c44f5d5d54d0ceaa0dd119db9
MINOR: backend: replace the lbprm lock with an rwlock

It was previously a spinlock, and it happens that a number of LB algos
only lock it for lookups, without performing any modification. Let's
first turn it to an rwlock and w-lock it everywhere. This is strictly
identical.

It was carefully checked that every HA_SPIN_LOCK() was turned to
HA_RWLOCK_WRLOCK() and that HA_SPIN_UNLOCK() was turned to
HA_RWLOCK_WRUNLOCK() on this lock. _INIT and _DESTROY were updated too.
include/haproxy/backend-t.h
src/cfgparse.c
src/haproxy.c
src/lb_chash.c
src/lb_fas.c
src/lb_fwlc.c
src/lb_fwrr.c
src/lb_map.c