diff options
author | David Leonard <d@cvs.openbsd.org> | 1999-02-04 06:28:14 +0000 |
---|---|---|
committer | David Leonard <d@cvs.openbsd.org> | 1999-02-04 06:28:14 +0000 |
commit | ba0a2a7598cec80429adbc8dd4d6598555d74c73 (patch) | |
tree | 6731ddf393df731f1e38e1647792158a9c57bf1f /lib/libc_r/BENCH/self_overhead.c | |
parent | be5e2374b04e8a93601fe65bd740fe1226a61bcd (diff) |
tidy
Diffstat (limited to 'lib/libc_r/BENCH/self_overhead.c')
-rw-r--r-- | lib/libc_r/BENCH/self_overhead.c | 6 |
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 --; } |