svn merge -r9818:10278 svn://svn.valgrind.org/valgrind/branches/DRDDEV

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10279 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/drd/drd_barrier.c b/drd/drd_barrier.c
index fceb644..268dfad 100644
--- a/drd/drd_barrier.c
+++ b/drd/drd_barrier.c
@@ -466,14 +466,22 @@
     * Combine all vector clocks that were stored in the pre_barrier_wait
     * wrapper with the vector clock of the current thread.
     */
-   VG_(OSetGen_ResetIter)(p->oset);
-   for ( ; (r = VG_(OSetGen_Next)(p->oset)) != 0; )
    {
-      if (r != q)
+      VectorClock old_vc;
+
+      DRD_(vc_copy)(&old_vc, &DRD_(g_threadinfo)[tid].last->vc);
+      VG_(OSetGen_ResetIter)(p->oset);
+      for ( ; (r = VG_(OSetGen_Next)(p->oset)) != 0; )
       {
-         tl_assert(r->sg[p->post_iteration]);
-         DRD_(thread_combine_vc2)(tid, &r->sg[p->post_iteration]->vc);
+         if (r != q)
+         {
+            tl_assert(r->sg[p->post_iteration]);
+            DRD_(vc_combine)(&DRD_(g_threadinfo)[tid].last->vc,
+                             &r->sg[p->post_iteration]->vc);
+         }
       }
+      DRD_(thread_update_conflict_set)(tid, &old_vc);
+      DRD_(vc_cleanup)(&old_vc);
    }
 
    /*