File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -337,9 +337,11 @@ static void signal_num_active_threads(pthreadpool_t threadpool,
337337}
338338
339339static 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 ,
You can’t perform that action at this time.
0 commit comments