Closed GoogleCodeExporter closed 9 years ago
The program is buggy, and ThreadSanitizer correctly detects it.
pthread_barrier_destroy() must not be called while threads execute
pthread_barrier_wait(). I can't find a definitive reference right now, but here
is something:
http://locklessinc.com/articles/barriers/
It's easy to find other references.
Only pthread_mutex_t can be destroyed that way.
So you need either use additional pthread_mutex_t to safely destroy the
barrier, or join the threads and then destroy the barrier.
Original comment by dvyu...@google.com
on 4 Jun 2013 at 2:45
Hi Yes I appreciate it is buggy I was trying to work out why.
I am obviously misunderstanding the return from wait is not guaranteeing what I
think it is. I was under the impressions all threads were released following
that call.
thanks
Original comment by steview....@googlemail.com
on 4 Jun 2013 at 3:02
Original issue reported on code.google.com by
steview....@googlemail.com
on 4 Jun 2013 at 2:34