summaryrefslogtreecommitdiffstats
path: root/src/ioq.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2023-06-26 11:35:23 -0400
committerTavian Barnes <tavianator@tavianator.com>2023-06-26 11:35:23 -0400
commit6b96d7b0ad73e6ed63cf5e32fd2544121e2b0284 (patch)
tree5edeababef5982f5aa0d8b1c69d5ebb7250e3898 /src/ioq.c
parent616392360afc3cfac55a24cc710e3607d8c4ee1d (diff)
downloadbfs-6b96d7b0ad73e6ed63cf5e32fd2544121e2b0284.tar.xz
ioq: Don't check NDEBUG manually in ioqq_trypop()
Diffstat (limited to 'src/ioq.c')
-rw-r--r--src/ioq.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/ioq.c b/src/ioq.c
index 47b082a..617bd5f 100644
--- a/src/ioq.c
+++ b/src/ioq.c
@@ -248,12 +248,9 @@ static union ioq_cmd *ioqq_trypop(struct ioqq *ioqq) {
prev &= ~IOQ_BLOCKED;
if (prev) {
-#ifdef NDEBUG
- store(&ioqq->tail, i + IOQ_STRIDE, relaxed);
-#else
- size_t j = fetch_add(&ioqq->tail, IOQ_STRIDE, relaxed);
+ size_t j = exchange(&ioqq->tail, i + IOQ_STRIDE, relaxed);
bfs_assert(j == i, "ioqq_trypop() only supports a single consumer");
-#endif
+ (void)j;
}
return (union ioq_cmd *)prev;