diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2014-09-04 11:07:42 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2014-09-04 11:07:42 +0000 |
commit | e2769ac10a86fcfb588824166fc16c36dcfc5c2c (patch) | |
tree | 5ef5091930821c767f97474c4dbe8d5f2fc94e6e /test/msan | |
parent | a8f5a36445cb4e264c4d650c2e40e638b1270e9a (diff) |
[msan] Fix fork test on centos-6.5.
Missing <atomic> header.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217142 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/msan')
-rw-r--r-- | test/msan/fork.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/test/msan/fork.cc b/test/msan/fork.cc index 3bb714395..eb7ad7b6a 100644 --- a/test/msan/fork.cc +++ b/test/msan/fork.cc @@ -20,11 +20,10 @@ #include <sys/time.h> #include <signal.h> #include <errno.h> -#include <atomic> #include <sanitizer/msan_interface.h> -std::atomic<bool> done; +int done; void copy_uninit_thread2() { volatile int x; @@ -32,7 +31,7 @@ void copy_uninit_thread2() { while (true) { v = x; x = v; - if (done.load()) + if (__atomic_load_n(&done, __ATOMIC_RELAXED)) return; } } @@ -62,7 +61,6 @@ void child() { } void test() { - done.store(false); const int kThreads = 10; pthread_t t[kThreads]; for (int i = 0; i < kThreads; ++i) @@ -71,7 +69,7 @@ void test() { pid_t pid = fork(); if (pid) { // parent - done.store(true); + __atomic_store_n(&done, 1, __ATOMIC_RELAXED); usleep(1000000); kill(pid, SIGKILL); } else { |