From: Bart Van Assche Date: Tue, 30 Aug 2011 15:09:37 +0000 (+0000) Subject: drd: Yet another regression test reliability improvement. X-Git-Tag: svn/VALGRIND_3_7_0~233 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=02130903061ab5eef106b828f912e0e664febc0b;p=thirdparty%2Fvalgrind.git drd: Yet another regression test reliability improvement. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12004 --- diff --git a/drd/tests/annotate_smart_pointer.cpp b/drd/tests/annotate_smart_pointer.cpp index cf6e6ac73e..862ecb0ef9 100644 --- a/drd/tests/annotate_smart_pointer.cpp +++ b/drd/tests/annotate_smart_pointer.cpp @@ -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(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();