std::experimental::flex_barrier with N
participating threads and a completion function.
The completion function allows additional synchronization or notification to be done when all participating threads have arrived at the barrier, and allows the number of participating threads to be changed.
When all participating threads have arrived at the barrier, the completion function is called with the current
number of participating threads (which may already have been reduced
due to calls to
If the completion function returns less than 0 then the number of participating threads is unchanged, otherwise the number of participating threads in the next cycle is set to the returned value.
template<typename CompletionFunc> explicit flex_barrier(ptrdiff_t num_threads,CompletionFunc comp_func):
shall be well-formed and not-throw any exceptions.
The newly-constructed flex_barrier has
participating threads. The completion function
is initialized as-if