]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
drd: Yet another regression test reliability improvement.
authorBart Van Assche <bvanassche@acm.org>
Tue, 30 Aug 2011 15:09:37 +0000 (15:09 +0000)
committerBart Van Assche <bvanassche@acm.org>
Tue, 30 Aug 2011 15:09:37 +0000 (15:09 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12004

drd/tests/annotate_smart_pointer.cpp

index cf6e6ac73e7041147c7f84394c65ee9ab81b591a..862ecb0ef9ebc44d04cfe40e2175c3abf89d17a7 100644 (file)
@@ -317,6 +317,12 @@ int main(int argc, char** argv)
     p->post_increment();
     for (int i = 0; i < nthreads; ++i)
       T[i].Create(thread_func, new smart_ptr<counter>(p));
+    {
+      // Avoid that counter.m_mutex introduces a false ordering on the
+      // counter.m_count accesses.
+      const timespec delay = { 0, 100 * 1000 * 1000 };
+      nanosleep(&delay, 0);
+    }
     p = NULL;
     for (int i = 0; i < nthreads; ++i)
       T[i].Join();