The following commit has been merged in the master branch:
commit 0182dbd13b39ba6bf6105123ed233bc8d138c0cd
Author: Andrew Deason <[email protected]>
Date: Sat Jul 6 15:06:48 2024 -0500
bozo: Make bozo_isrestricted atomic
The bosserver global bozo_isrestricted is often accessed without any
locks. It's a simple boolean that doesn't need coordination with
anything else, but on pthreads, accessing this from different threads is
technically undefined behavior. To avoid this, convert bozo_isrestricted
to be an rx_atomic_t, which can be accessed safely from different
threads.
Access this global through the new functions bozo_IsRestricted() and
bozo_SetRestricted(), to make it easier to change how we access this
global in the future, if we need to. Change the name of the global to
bozo_restricted and declare it 'static', to try to make sure we haven't
left behind any old users.
Do the same thing for the bozo_restdisable global, too (renamed to
bozo_restricted_disabled), except don't add accessor functions, since
this is only used in a small number of places.
While we could instead make these globals be protected by a lock (such
as BNODE_LOCK()), using atomics is a little simpler, since we don't need
to worry about whether we have obtained the relevant lock.
Change-Id: If8d8dcc2103b084bebb152440ddd52b85cfa26b0
Reviewed-on: https://gerrit.openafs.org/15779
Reviewed-by: Michael Meffie <[email protected]>
Reviewed-by: Benjamin Kaduk <[email protected]>
Tested-by: BuildBot <[email protected]>
src/bozo/bosoprocs.c | 21 ++++++++++-----------
src/bozo/bosprototypes.h | 2 ++
src/bozo/bosserver.c | 36 ++++++++++++++++++++++++++----------
3 files changed, 38 insertions(+), 21 deletions(-)
--
OpenAFS Master Repository
_______________________________________________
OpenAFS-cvs mailing list
[email protected]
https://lists.openafs.org/mailman/listinfo/openafs-cvs