configure: Force --disable-input-thread for MinGW

I don't think an input thread can ever be useful on Windows.

There is a pthread emulation, so having the thread itself isn't much of
a problem.

However, there is no device to wait on for Windows events, and even if
we were to replace select() with WFMO, Windows wants to send events for
a window to the thread which created that window.

So, disable input thread by default for MinGW

v2:
Also add similar to meson.build
This commit is contained in:
Jon Turney 2016-07-28 14:26:38 +01:00
parent 29a8baa031
commit 246b729df8
2 changed files with 8 additions and 0 deletions

View File

@ -791,6 +791,11 @@ if test "x$HAVE_RECURSIVE_MUTEX" = "xyes" ; then
THREAD_DEFAULT=yes
fi
case $host_os in
mingw*) THREAD_DEFAULT=no ;;
*)
esac
AC_ARG_ENABLE(input-thread, AS_HELP_STRING([--enable-input-thread],
[Enable input threads]),
[INPUTTHREAD=$enableval], [INPUTTHREAD=$THREAD_DEFAULT])

View File

@ -60,6 +60,9 @@ else
if not enable_input_thread and get_option('input_thread') == 'true'
error('Input thread enabled and PTHREAD_MUTEX_RECURSIVE not found')
endif
if host_machine.system() == 'windows' and get_option('input_thread') == 'auto'
enable_input_thread = false
endif
endif
conf_data.set('HAVE_INPUTTHREAD', enable_input_thread)