diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2024-06-03 09:23:33 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2024-06-03 09:23:33 -0400 |
commit | 247338968dea83838caae6852363f7282ece558e (patch) | |
tree | 94218eb2582f34a72537b513a0d2c7572adb15fe /src/sighook.c | |
parent | 118a9053f04d0e215bb3fe20562990cc73ae69a2 (diff) | |
download | bfs-247338968dea83838caae6852363f7282ece558e.tar.xz |
sighook: Check that atomic size_t is lock-free
Diffstat (limited to 'src/sighook.c')
-rw-r--r-- | src/sighook.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/sighook.c b/src/sighook.c index ece8147..3a7fb43 100644 --- a/src/sighook.c +++ b/src/sighook.c @@ -52,6 +52,8 @@ struct arc { /** Initialize an arc. */ static void arc_init(struct arc *arc) { + bfs_verify(atomic_is_lock_free(&arc->refs)); + atomic_init(&arc->refs, 0); arc->ptr = NULL; @@ -166,6 +168,8 @@ static void *RCU_NULL = &RCU_NULL; /** Initialize an RCU block. */ static void rcu_init(struct rcu *rcu) { + bfs_verify(atomic_is_lock_free(&rcu->active)); + atomic_init(&rcu->active, 0); arc_init(&rcu->slots[0]); arc_init(&rcu->slots[1]); |