drd: Fix a race condition in the barrier implementation that could result in false positives.

What could occur before this fix is:
- The pthread_barrier() call in a first thread finishes.
- Another thread invokes pthread_join() on that thread, causing the information
  associated with that thread to be removed from the barrier object.
- The pthread_barrier() call in another thread finishes. Because some
  thread information has already been removed from the barrier object, the
  per-thread vector clock "last" won't be computed correctly by
  DRD_(barrier_post_wait)().
- Because of the above false positives could be reported.

This resulted in sporadic failure of the drd/tests/matinv regression test, and
should now be fixed.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11945 a5019735-40e9-0310-863c-91ae7b9d1cf9
2 files changed