summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2015-11-12 10:24:22 +0000
committerDmitry Vyukov <dvyukov@google.com>2015-11-12 10:24:22 +0000
commit1041aabbb0b3ddccf33542e7e7ebba44ea2fe715 (patch)
tree58e560d5f71d814da91cfc3f1cf616f3501b323f
parent8e3b38aba16c286d0cfa9e7b544438bea6acb83b (diff)
downloadbcm5719-llvm-1041aabbb0b3ddccf33542e7e7ebba44ea2fe715.tar.gz
bcm5719-llvm-1041aabbb0b3ddccf33542e7e7ebba44ea2fe715.zip
tsan: fix flakiness of sleep_sync2 test
llvm-svn: 252869
-rw-r--r--compiler-rt/test/tsan/test.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler-rt/test/tsan/test.h b/compiler-rt/test/tsan/test.h
index adc44bbe960..27f6573d464 100644
--- a/compiler-rt/test/tsan/test.h
+++ b/compiler-rt/test/tsan/test.h
@@ -4,6 +4,7 @@
#include <unistd.h>
#include <dlfcn.h>
#include <stddef.h>
+#include <sched.h>
// TSan-invisible barrier.
// Tests use it to establish necessary execution order in a way that does not
@@ -25,7 +26,9 @@ void barrier_wait(invisible_barrier_t *barrier) {
unsigned cur_epoch = (cur >> 8) / (cur & 0xff);
if (cur_epoch != old_epoch)
return;
- usleep(1000);
+ // Can't use usleep, because it leads to spurious "As if synchronized via
+ // sleep" messages which fail some output tests.
+ sched_yield();
}
}
OpenPOWER on IntegriCloud