diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-02-10 07:45:43 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-02-10 07:45:43 +0000 |
commit | 476c4db3dc56bee43df384704c75ccc71cfa7a1d (patch) | |
tree | 5d0dcec3cc12fc53532fc84029892b98711a2596 /test/tsan/simple_race.cc | |
parent | ca9211ecdede9bdedb812b2243a4abdb8dacd1b9 (diff) | |
download | src-476c4db3dc56bee43df384704c75ccc71cfa7a1d.tar.gz src-476c4db3dc56bee43df384704c75ccc71cfa7a1d.zip |
Import compiler-rt trunk r228651.vendor/compiler-rt/compiler-rt-r228651
Notes
Notes:
svn path=/vendor/compiler-rt/dist/; revision=278497
svn path=/vendor/compiler-rt/compiler-rt-r228651/; revision=278498; tag=vendor/compiler-rt/compiler-rt-r228651
Diffstat (limited to 'test/tsan/simple_race.cc')
-rw-r--r-- | test/tsan/simple_race.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/tsan/simple_race.cc b/test/tsan/simple_race.cc index f711bb5d114d..612ce2dc0c4f 100644 --- a/test/tsan/simple_race.cc +++ b/test/tsan/simple_race.cc @@ -1,22 +1,22 @@ // RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s -#include <pthread.h> -#include <stdio.h> -#include <unistd.h> +#include "test.h" int Global; void *Thread1(void *x) { - sleep(1); + barrier_wait(&barrier); Global++; return NULL; } void *Thread2(void *x) { Global--; + barrier_wait(&barrier); return NULL; } int main() { + barrier_init(&barrier, 2); pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); |