From e7a4f449b8d928b435cf6dc0ee7260fd628fd9e0 Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Mon, 19 Oct 1998 09:15:53 +0000 Subject: [PATCH] YIELD more robustly. p4raw-id: //depot/cfgperl@2020 --- thread.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/thread.h b/thread.h index f883ced..dafaa1e 100644 --- a/thread.h +++ b/thread.h @@ -25,7 +25,19 @@ #endif #ifndef YIELD -# define YIELD SCHED_YIELD +# ifdef SCHED_YIELD +# define YIELD SCHED_YIELD +# else +# ifdef HAS_SCHED_YIELD +# define YIELD sched_yield() +# else +# ifdef HAS_PTHREAD_YIELD + /* pthread_yield(NULL) platforms are expected + * to have #defined YIELD for themselves. */ +# define YIELD pthread_yield() +# endif +# endif +# endif #endif #ifdef PTHREAD_CREATE_JOINABLE -- 2.7.4