diff options
author | Stef Walter <stef@memberwebs.com> | 2009-03-26 17:30:49 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2009-03-26 17:30:49 +0000 |
commit | a292e665e7aa78cc8a9ad3569328e06917639c22 (patch) | |
tree | d72c357dd22926e9d8876f20ff1f16cacd281399 /common/tpool.c | |
parent | 9e1de4e71db2c5b32bb8349584bafc22d6e29752 (diff) |
Support for building on Solaris.
Diffstat (limited to 'common/tpool.c')
-rw-r--r-- | common/tpool.c | 8 |
1 files changed, 7 insertions, 1 deletions
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 <stdio.h> #include <stdlib.h> #include <errno.h> -#include <err.h> #include <string.h> #include <assert.h> #include <signal.h> @@ -43,6 +42,7 @@ #define __USE_GNU #include <pthread.h> +#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)); } |