From a292e665e7aa78cc8a9ad3569328e06917639c22 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Thu, 26 Mar 2009 17:30:49 +0000 Subject: Support for building on Solaris. --- common/tpool.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'common/tpool.c') diff --git a/common/tpool.c b/common/tpool.c index f980b86..ff868de 100644 --- a/common/tpool.c +++ b/common/tpool.c @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include @@ -43,6 +42,7 @@ #define __USE_GNU #include +#include "compat.h" #include "tpool.h" typedef struct _tpool_work { @@ -319,7 +319,13 @@ tpool_add_work (void (*routine)(void*), void *arg) */ if (tpool_max_queue_size > 0 && tpool_cur_queue_size >= tpool_max_queue_size) { PTHREQ (pthread_mutex_unlock (&tpool_queue_lock)); +#if defined(HAVE_THR_YIELD) + thr_yield(); +#elif defined(HAVE_PTHREAD_YIELD) pthread_yield(); +#elif defined(HAVE_SCHED_YIELD) + sched_yield(); +#endif PTHREQ (pthread_mutex_lock (&tpool_queue_lock)); } -- cgit v1.2.3