diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2023-06-26 11:35:23 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2023-06-26 11:35:23 -0400 |
commit | 6b96d7b0ad73e6ed63cf5e32fd2544121e2b0284 (patch) | |
tree | 5edeababef5982f5aa0d8b1c69d5ebb7250e3898 | |
parent | 616392360afc3cfac55a24cc710e3607d8c4ee1d (diff) | |
download | bfs-6b96d7b0ad73e6ed63cf5e32fd2544121e2b0284.tar.xz |
ioq: Don't check NDEBUG manually in ioqq_trypop()
-rw-r--r-- | src/ioq.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -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; |