summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--compiler-rt/test/lsan/TestCases/use_registers.cc5
-rw-r--r--compiler-rt/test/lsan/TestCases/use_stacks_threaded.cc5
2 files changed, 6 insertions, 4 deletions
diff --git a/compiler-rt/test/lsan/TestCases/use_registers.cc b/compiler-rt/test/lsan/TestCases/use_registers.cc
index d436144a8ef..ce11c3f77bc 100644
--- a/compiler-rt/test/lsan/TestCases/use_registers.cc
+++ b/compiler-rt/test/lsan/TestCases/use_registers.cc
@@ -7,6 +7,7 @@
#include <assert.h>
#include <pthread.h>
+#include <sched.h>
#include <stdio.h>
#include <stdlib.h>
@@ -33,7 +34,7 @@ void *registers_thread_func(void *arg) {
fflush(stderr);
__sync_fetch_and_xor(sync, 1);
while (true)
- pthread_yield();
+ sched_yield();
}
int main() {
@@ -42,7 +43,7 @@ int main() {
int res = pthread_create(&thread_id, 0, registers_thread_func, &sync);
assert(res == 0);
while (!__sync_fetch_and_xor(&sync, 0))
- pthread_yield();
+ sched_yield();
return 0;
}
// CHECK: Test alloc: [[ADDR:.*]].
diff --git a/compiler-rt/test/lsan/TestCases/use_stacks_threaded.cc b/compiler-rt/test/lsan/TestCases/use_stacks_threaded.cc
index fc4e661c261..a1d4383e956 100644
--- a/compiler-rt/test/lsan/TestCases/use_stacks_threaded.cc
+++ b/compiler-rt/test/lsan/TestCases/use_stacks_threaded.cc
@@ -7,6 +7,7 @@
#include <assert.h>
#include <pthread.h>
+#include <sched.h>
#include <stdio.h>
#include <stdlib.h>
@@ -18,7 +19,7 @@ void *stacks_thread_func(void *arg) {
fflush(stderr);
__sync_fetch_and_xor(sync, 1);
while (true)
- pthread_yield();
+ sched_yield();
}
int main() {
@@ -27,7 +28,7 @@ int main() {
int res = pthread_create(&thread_id, 0, stacks_thread_func, &sync);
assert(res == 0);
while (!__sync_fetch_and_xor(&sync, 0))
- pthread_yield();
+ sched_yield();
return 0;
}
// CHECK: Test alloc: [[ADDR:.*]].
OpenPOWER on IntegriCloud