@@ -442,7 +442,7 @@ no)
;;
esac
-AC_CHECK_HEADERS(sys/mman.h syscall.h sys/epoll.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/if.h)
+AC_CHECK_HEADERS(sys/mman.h syscall.h sys/epoll.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/if.h thread.h)
AC_CHECK_HEADERS([linux/filter.h linux/netlink.h linux/rtnetlink.h], [], [],
[#ifdef HAVE_SYS_SOCKET_H
@@ -452,7 +452,7 @@ AC_CHECK_HEADERS([linux/filter.h linux/n
AM_CONDITIONAL(HAVE_SYS_MMAN_H, test "$ac_cv_header_sys_mman_h" = yes)
-AC_CHECK_FUNCS(srandom random strerror_r strsignal wait4 mincore setenv)
+AC_CHECK_FUNCS(srandom random strerror_r strsignal wait4 mincore setenv pthread_yield thr_yield)
AM_CONDITIONAL(HAVE_STRERROR_R, test "$ac_cv_func_strerror_r" = yes)
AM_CONDITIONAL(HAVE_WAIT4, test "$ac_cv_func_wait4" = yes)
@@ -9,6 +9,9 @@
#include <stddef.h>
#include <sys/types.h>
#include <sys/time.h>
+#ifdef HAVE_THREAD_H
+#include <thread.h>
+#endif
#include <pthread.h>
#include <unistd.h>
@@ -38,7 +41,11 @@ runtime_procyield (uint32 cnt)
void
runtime_osyield (void)
{
+#ifdef HAVE_THR_YIELD
+ thr_yield ();
+#elif defined(HAVE_PTHREAD_YIELD)
pthread_yield ();
+#endif
}
/* Sleep for some number of microseconds. */