summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbart <bart@a5019735-40e9-0310-863c-91ae7b9d1cf9>2011-08-30 15:09:37 +0000
committerbart <bart@a5019735-40e9-0310-863c-91ae7b9d1cf9>2011-08-30 15:09:37 +0000
commit863f1ebabe3b97854383c27cc708ddeb0c8c7425 (patch)
tree634b99211dcf0434706a15a7dd6e7bd8e5da8ca4
parent5cbd26ec7cc2033d27e3b24b0dec71e3b958db8f (diff)
drd: Yet another regression test reliability improvement.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12004 a5019735-40e9-0310-863c-91ae7b9d1cf9
-rw-r--r--drd/tests/annotate_smart_pointer.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/drd/tests/annotate_smart_pointer.cpp b/drd/tests/annotate_smart_pointer.cpp
index cf6e6ac7..862ecb0e 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<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();