[compiler-rt] r252283 - [tsan] Replace pthread_yield with sched_yield in lit tests
Kuba Brecka via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 6 03:05:53 PST 2015
Author: kuba.brecka
Date: Fri Nov 6 05:05:53 2015
New Revision: 252283
URL: http://llvm.org/viewvc/llvm-project?rev=252283&view=rev
Log:
[tsan] Replace pthread_yield with sched_yield in lit tests
OS X doesn't have `pthread_yield`. Let's use `sched_yield` instead.
Differential Revision: http://reviews.llvm.org/D14428
Modified:
compiler-rt/trunk/test/tsan/atomic_free3.cc
compiler-rt/trunk/test/tsan/real_deadlock_detector_stress_test.cc
compiler-rt/trunk/test/tsan/signal_errno.cc
Modified: compiler-rt/trunk/test/tsan/atomic_free3.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/atomic_free3.cc?rev=252283&r1=252282&r2=252283&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/atomic_free3.cc (original)
+++ compiler-rt/trunk/test/tsan/atomic_free3.cc Fri Nov 6 05:05:53 2015
@@ -13,7 +13,7 @@ int main() {
pthread_t t;
pthread_create(&t, 0, Thread, a);
while (__atomic_load_n(a, __ATOMIC_RELAXED) == 0)
- pthread_yield();
+ sched_yield();
delete a;
pthread_join(t, 0);
}
Modified: compiler-rt/trunk/test/tsan/real_deadlock_detector_stress_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/real_deadlock_detector_stress_test.cc?rev=252283&r1=252282&r2=252283&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/real_deadlock_detector_stress_test.cc (original)
+++ compiler-rt/trunk/test/tsan/real_deadlock_detector_stress_test.cc Fri Nov 6 05:05:53 2015
@@ -59,7 +59,7 @@ void *Thread(void *seed) {
for (;;) {
int old = __atomic_load_n(&m->state, __ATOMIC_RELAXED);
if (old == kStateLocked) {
- pthread_yield();
+ sched_yield();
continue;
}
int newv = old + 1;
Modified: compiler-rt/trunk/test/tsan/signal_errno.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/signal_errno.cc?rev=252283&r1=252282&r2=252283&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/signal_errno.cc (original)
+++ compiler-rt/trunk/test/tsan/signal_errno.cc Fri Nov 6 05:05:53 2015
@@ -24,7 +24,7 @@ static __attribute__((noinline)) void lo
volatile char *p = (char*)malloc(1);
p[0] = 0;
free((void*)p);
- pthread_yield();
+ sched_yield();
}
}
More information about the llvm-commits
mailing list