From 12de706f2fd387981e5925a1e42207934613660f Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 21 Jan 2015 13:50:02 +0000 Subject: tsan: remove sleeps from tests Even sleep(1) lead to episodical flakes on some machines. Use an invisible by tsan barrier to enforce required execution order instead. This makes the tests deterministic and faster. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@226659 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/tsan/signal_sync.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'test/tsan/signal_sync.cc') diff --git a/test/tsan/signal_sync.cc b/test/tsan/signal_sync.cc index 15387b754..6ff19d3bd 100644 --- a/test/tsan/signal_sync.cc +++ b/test/tsan/signal_sync.cc @@ -1,11 +1,8 @@ // RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s -#include -#include -#include +#include "test.h" #include #include #include -#include #include volatile int X; @@ -18,7 +15,7 @@ static void handler(int sig) { static void* thr(void *p) { for (int i = 0; i != 1000; i++) - usleep(1000); + usleep(1000); // process signals return 0; } -- cgit v1.2.3