summaryrefslogtreecommitdiff
path: root/lib/libc_r/BENCH/self_overhead.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc_r/BENCH/self_overhead.c')
-rw-r--r--lib/libc_r/BENCH/self_overhead.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libc_r/BENCH/self_overhead.c b/lib/libc_r/BENCH/self_overhead.c
index eea74cfc75e..f48bd166a5d 100644
--- a/lib/libc_r/BENCH/self_overhead.c
+++ b/lib/libc_r/BENCH/self_overhead.c
@@ -1,4 +1,6 @@
+#include <stdio.h>
#include <pthread.h>
+#include <sched.h>
#include <string.h>
#include <err.h>
#include "bench.h"
@@ -34,7 +36,7 @@ numthreads(n)
if (error != 0)
errx(1, "pthread_create #%d: %s", nthreads,
strerror(error));
- pthread_yield();
+ sched_yield();
nthreads++;
}
@@ -42,7 +44,7 @@ numthreads(n)
error = pthread_cancel(children[nthreads - 1]);
if (error != 0)
errx(1, "pthread_cancel: %s", strerror(error));
- pthread_yield();
+ sched_yield();
nthreads --;
}