event: add poll() based PollGroup implementation

This commit is contained in:
Denis Krjuchkov
2013-11-30 14:45:56 +06:00
parent 023482406f
commit 1df426aa5c
5 changed files with 164 additions and 1 deletions

View File

@@ -160,6 +160,7 @@ dnl ---------------------------------------------------------------------------
dnl Event loop selection
dnl ---------------------------------------------------------------------------
MPD_OPTIONAL_FUNC_NODEF(poll, poll)
MPD_OPTIONAL_FUNC_NODEF(epoll, epoll_create1)
AC_ARG_WITH(eventloop,
@@ -170,7 +171,7 @@ AC_ARG_WITH(eventloop,
AC_ARG_WITH(pollmethod,
AS_HELP_STRING(
[--with-pollmethod=@<:@epoll|winselect|auto@:>@],
[--with-pollmethod=@<:@epoll|poll|winselect|auto@:>@],
[specify poll method for internal event loop (default=auto)]),,
[with_pollmethod=auto])
@@ -202,6 +203,8 @@ if test "x$with_eventloop" = xinternal; then
if test "x$with_pollmethod" = xauto; then
if test "x$enable_epoll" = xyes; then
with_pollmethod=epoll
elif test "x$enable_poll" = xyes; then
with_pollmethod=poll
elif test "x$host_is_windows" = xyes; then
with_pollmethod=winselect
else
@@ -212,6 +215,9 @@ if test "x$with_eventloop" = xinternal; then
epoll)
AC_DEFINE(USE_EPOLL, 1, [Define to poll sockets with epoll])
;;
poll)
AC_DEFINE(USE_POLL, 1, [Define to poll sockets with poll])
;;
winselect)
AC_DEFINE(USE_WINSELECT, 1,
[Define to poll sockets with Windows select])