summaryrefslogtreecommitdiff
path: root/lib/libc_r/BENCH/self_overhead.c
diff options
context:
space:
mode:
authorDavid Leonard <d@cvs.openbsd.org>1999-02-04 06:28:14 +0000
committerDavid Leonard <d@cvs.openbsd.org>1999-02-04 06:28:14 +0000
commitba0a2a7598cec80429adbc8dd4d6598555d74c73 (patch)
tree6731ddf393df731f1e38e1647792158a9c57bf1f /lib/libc_r/BENCH/self_overhead.c
parentbe5e2374b04e8a93601fe65bd740fe1226a61bcd (diff)
tidy
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 --;
}