Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Moved pthread spinlock check in with the rest of the pthread tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Sep 21, 2011
1 parent 71c39df commit 4a98254
Showing 1 changed file with 9 additions and 19 deletions.
28 changes: 9 additions & 19 deletions configure.in
Expand Up @@ -277,25 +277,6 @@ if test x$enable_gcc_atomics = xyes; then
fi
fi

# Check for pthread implementation
AC_MSG_CHECKING(for pthread spinlock)
have_pthread_spinlock=no

AC_TRY_LINK([
#include <pthread.h>
],[
pthread_spinlock_t a;
pthread_spin_trylock(&a);
pthread_spin_unlock(&a);
],[
have_pthread_spinlock=yes
])
AC_MSG_RESULT($have_pthread_spinlock)
if test x$have_pthread_spinlock = xyes; then
AC_DEFINE(HAVE_PTHREAD_SPINLOCK, 1, [ ])
fi


# Standard C sources
SOURCES="$SOURCES $srcdir/src/*.c"
SOURCES="$SOURCES $srcdir/src/atomic/*.c"
Expand Down Expand Up @@ -1652,6 +1633,15 @@ AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]])
AC_MSG_RESULT($have_pthread_sem)
fi

AC_MSG_CHECKING(for pthread_spin_trylock)
AC_TRY_LINK_FUNC(pthread_spin_trylock, [
has_pthread_spin_trylock=yes
AC_DEFINE(HAVE_PTHREAD_SPINLOCK, 1, [ ])
],[
has_pthread_spin_trylock=no
])
AC_MSG_RESULT($has_pthread_spin_trylock)

# Restore the compiler flags and libraries
CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"

Expand Down

0 comments on commit 4a98254

Please sign in to comment.