diff options
Diffstat (limited to 'lib/tsan/lit_tests/vptr_harmful_race.cc')
-rw-r--r-- | lib/tsan/lit_tests/vptr_harmful_race.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/tsan/lit_tests/vptr_harmful_race.cc b/lib/tsan/lit_tests/vptr_harmful_race.cc index f51ba7ee57f0b..76d31c00ad4f8 100644 --- a/lib/tsan/lit_tests/vptr_harmful_race.cc +++ b/lib/tsan/lit_tests/vptr_harmful_race.cc @@ -2,6 +2,7 @@ #include <pthread.h> #include <semaphore.h> #include <stdio.h> +#include <unistd.h> struct A { A() { @@ -34,6 +35,7 @@ void *Thread1(void *x) { } void *Thread2(void *x) { + sleep(1); delete obj; return NULL; } @@ -46,4 +48,4 @@ int main() { pthread_join(t[1], NULL); } -// CHECK: WARNING: ThreadSanitizer: data race +// CHECK: WARNING: ThreadSanitizer: data race on vptr |