]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: cache: Switch shctx spinlock to rwlock and restrict its scope
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Thu, 16 Nov 2023 16:38:21 +0000 (17:38 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Thu, 16 Nov 2023 18:35:10 +0000 (19:35 +0100)
commited35b9411a58b82f10bc42e245c21aa804317669
tree224d28625460f925651ade4d6b71ed347ea3b445
parenta0d7c290ecef26f3b39dc84b8c0c3972207bf913
MEDIUM: cache: Switch shctx spinlock to rwlock and restrict its scope

Since a lock on the cache tree was added in the latest cache changes, we
do not need to use the shared_context's lock to lock more than pure
shared_context related data anymore. This already existing lock will now
only cover the 'avail' list from the shared_context. It can then be
changed to a rwlock instead of a spinlock because we might want to only
run through the avail list sometimes.

Apart form changing the type of the shctx lock, the main modification
introduced by this patch is to limit the amount of code covered by the
shctx lock. This lock does not need to cover any code strictly related
to the cache tree anymore.
include/haproxy/shctx-t.h
include/haproxy/shctx.h
src/cache.c
src/shctx.c
src/ssl_sock.c