host_win32=no
target_win32=no
platform_android=no
+platform_darwin=no
case "$host" in
*-mingw*|*-*-cygwin*)
AC_DEFINE(HOST_WIN32,1,[Host Platform is Win32])
havekqueue=no
AC_CHECK_FUNCS(kqueue, , AC_MSG_CHECKING(for kqueue in sys/event.h)
AC_TRY_LINK([#include <sys/event.h>],
- [ kqueue(); ],
- AC_DEFINE(HAVE_KQUEUE, 1, [Have kqueue]) AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no)))
+ [ kqueue(); ],[havekqueue=yes],[]))
+ AC_MSG_RESULT($havekqueue);
+
+ dnl **************************************
+ dnl * Darwin has a race that prevents us from using reliably:
+ dnl * http://lists.apple.com/archives/darwin-dev/2011/Jun/msg00016.html
+ dnl * Since kqueue is mostly used for scaling large web servers,
+ dnl * and very few folks run Mono on large web servers on OSX, falling
+ dnl * back
+ dnl **************************************
+ if test x$havekqueue = xyes; then
+ if x$platform_darwin = xno; then
+ AC_DEFINE(USE_KQUEUE_FOR_THREADPOOL, 1, [Use kqueue for the threadpool])
+ fi
+ fi
+
dnl ******************************
dnl *** Checks for SIOCGIFCONF ***
dnl ******************************
#include <mono/metadata/tpool-poll.c>
#ifdef HAVE_EPOLL
#include <mono/metadata/tpool-epoll.c>
-#elif defined(HAVE_KQUEUE)
+#elif defined(USE_KQUEUE_FOR_THREADPOOL)
#include <mono/metadata/tpool-kqueue.c>
#endif
/*
data->event_system = POLL_BACKEND;
}
}
-#elif defined(HAVE_KQUEUE)
+#elif defined(USE_KQUEUE_FOR_THREADPOOL)
if (data->event_system == KQUEUE_BACKEND)
data->event_data = tp_kqueue_init (data);
#endif
data->sock_to_state = mono_g_hash_table_new_type (g_direct_hash, g_direct_equal, MONO_HASH_VALUE_GC);
#ifdef HAVE_EPOLL
data->event_system = EPOLL_BACKEND;
-#elif defined(HAVE_KQUEUE)
+#elif defined(USE_KQUEUE_FOR_THREADPOOL)
data->event_system = KQUEUE_BACKEND;
#else
data->event_system = POLL_BACKEND;