From eac8cc7a42c5469a9af154b10f0fc19e57744656 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 18 Mar 2014 06:37:31 +0000 Subject: tsan: fix flaky test llvm-svn: 204119 --- compiler-rt/test/tsan/load_shared_lib.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'compiler-rt/test/tsan/load_shared_lib.cc') diff --git a/compiler-rt/test/tsan/load_shared_lib.cc b/compiler-rt/test/tsan/load_shared_lib.cc index d60cd5700a8..5b6b72b6edb 100644 --- a/compiler-rt/test/tsan/load_shared_lib.cc +++ b/compiler-rt/test/tsan/load_shared_lib.cc @@ -9,19 +9,23 @@ #include #include #include +#include +#include #include int GLOB = 0; void *write_glob(void *unused) { + if (unused) + sleep(1); GLOB++; return NULL; } void race_two_threads(void *(*access_callback)(void *unused)) { pthread_t t1, t2; - pthread_create(&t1, NULL, access_callback, NULL); + pthread_create(&t1, NULL, access_callback, (void*)1); pthread_create(&t2, NULL, access_callback, NULL); pthread_join(t1, NULL); pthread_join(t2, NULL); -- cgit v1.2.1