>
> As reported by Luc, there is a race where the barrier is destroyed by one
> thread, while the other thread did not yet leave pthread_barrier_wait.
Please correct me if I am wrong. We are using the pthread_barrier to
1) know when to free 'params'.
2) set the thread affinity before the thread
Hi Olivier,
> Thank you for reporting this problem and submitting the patch.
> I think the issue can be fixed without any loop, like in this
> patch. What do you think?
I think getting rid of the loop is an excellent idea. Good thinking.
Your version is much cleaner.
> + __atomic_store_n(ΒΆ
As reported by Luc, there is a race where the barrier is destroyed by
one thread, while the other thread did not yet leave
pthread_barrier_wait.
This patch fixes the race condition by adding an atomic counter to
ensure that the barrier is destroyed only it is not used by any thread.
Fixes: 3a0d46
3 matches
Mail list logo