diff options
author | Dmitry Vyukov <dvyukov@google.com> | 2015-04-20 10:35:21 +0000 |
---|---|---|
committer | Dmitry Vyukov <dvyukov@google.com> | 2015-04-20 10:35:21 +0000 |
commit | 3ff1c381e0baa22e4b265c56c9e49f0132190b45 (patch) | |
tree | f3e0a722a97e008cffc44b73946b2c0b3a5e7bac /compiler-rt/test/tsan/java_race.cc | |
parent | 8586e2352be744b8d6706fbc2b1ac3b8a5410788 (diff) | |
download | bcm5719-llvm-3ff1c381e0baa22e4b265c56c9e49f0132190b45.tar.gz bcm5719-llvm-3ff1c381e0baa22e4b265c56c9e49f0132190b45.zip |
tsan: deflake a test
llvm-svn: 235294
Diffstat (limited to 'compiler-rt/test/tsan/java_race.cc')
-rw-r--r-- | compiler-rt/test/tsan/java_race.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler-rt/test/tsan/java_race.cc b/compiler-rt/test/tsan/java_race.cc index ede058e85d8..140a2a3c19d 100644 --- a/compiler-rt/test/tsan/java_race.cc +++ b/compiler-rt/test/tsan/java_race.cc @@ -2,11 +2,13 @@ #include "java.h" void *Thread(void *p) { + barrier_wait(&barrier); *(int*)p = 42; return 0; } int main() { + barrier_init(&barrier, 2); int const kHeapSize = 1024 * 1024; jptr jheap = (jptr)malloc(kHeapSize + 8) + 8; __tsan_java_init(jheap, kHeapSize); @@ -15,6 +17,7 @@ int main() { pthread_t th; pthread_create(&th, 0, Thread, (void*)jheap); *(int*)jheap = 43; + barrier_wait(&barrier); pthread_join(th, 0); __tsan_java_free(jheap, kBlockSize); fprintf(stderr, "DONE\n"); |