diff options
| author | Erwin Lansing <erwin@FreeBSD.org> | 2014-02-24 13:58:58 +0000 |
|---|---|---|
| committer | Erwin Lansing <erwin@FreeBSD.org> | 2014-02-24 13:58:58 +0000 |
| commit | 989b3b2d6068ce5b525479b7754977baf6364a7d (patch) | |
| tree | dbbce28742bfdb3ea58da4461b1bb3e5c2fcaa28 /lib/isc/pthreads/thread.c | |
| parent | 98ec2cd1facbb6a0e284fd0bacab33fbafb76fb8 (diff) | |
Notes
Diffstat (limited to 'lib/isc/pthreads/thread.c')
| -rw-r--r-- | lib/isc/pthreads/thread.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/isc/pthreads/thread.c b/lib/isc/pthreads/thread.c index 1b250fac2801..97821a2cadb0 100644 --- a/lib/isc/pthreads/thread.c +++ b/lib/isc/pthreads/thread.c @@ -21,6 +21,10 @@ #include <config.h> +#if defined(HAVE_SCHED_H) +#include <sched.h> +#endif + #include <isc/thread.h> #include <isc/util.h> @@ -74,3 +78,14 @@ isc_thread_setconcurrency(unsigned int level) { UNUSED(level); #endif } + +void +isc_thread_yield(void) { +#if defined(HAVE_SCHED_YIELD) + sched_yield(); +#elif defined( HAVE_PTHREAD_YIELD) + pthread_yield(); +#elif defined( HAVE_PTHREAD_YIELD_NP) + pthread_yield_np(); +#endif +} |
