Skip to content

Commit 9c703c6

Browse files
committed
Automated Code Change
PiperOrigin-RevId: 908850208
1 parent a56dcd7 commit 9c703c6

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/pthreads.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,11 @@ static void signal_num_active_threads(pthreadpool_t threadpool,
337337
}
338338

339339
static void signal_work_is_done(pthreadpool_t threadpool) {
340+
#ifndef NDEBUG
340341
uint32_t prev_value = pthreadpool_exchange_acquire_release_uint32_t(
341342
&threadpool->work_is_done, 1);
342343
assert(prev_value == 0);
344+
#endif // NDEBUG
343345
#if PTHREADPOOL_USE_FUTEX
344346
futex_wake_all(&threadpool->work_is_done);
345347
#else
@@ -670,10 +672,12 @@ PTHREADPOOL_INTERNAL void pthreadpool_parallelize(
670672
pthreadpool_fence_acquire();
671673

672674
/* Make sure the threadpool is idle or done. */
675+
#ifndef NDEBUG
673676
const int32_t num_active_threads =
674677
pthreadpool_load_consume_int32_t(&threadpool->num_active_threads);
675678
assert(num_active_threads == 0 ||
676679
num_active_threads == PTHREADPOOL_NUM_ACTIVE_THREADS_DONE);
680+
#endif // NDEBUG
677681

678682
/* Setup global arguments */
679683
pthreadpool_store_relaxed_void_p(&threadpool->thread_function,

0 commit comments

Comments
 (0)