There's no pthread_yield() on OSX (only sched_yield() and pthread_yield_np()).
llvm-svn: 213516
#include <assert.h>
#include <pthread.h>
+#include <sched.h>
#include <stdio.h>
#include <stdlib.h>
fflush(stderr);
__sync_fetch_and_xor(sync, 1);
while (true)
- pthread_yield();
+ sched_yield();
}
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:.*]].
#include <assert.h>
#include <pthread.h>
+#include <sched.h>
#include <stdio.h>
#include <stdlib.h>
fflush(stderr);
__sync_fetch_and_xor(sync, 1);
while (true)
- pthread_yield();
+ sched_yield();
}
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:.*]].