Moved pthread spinlock check in with the rest of the pthread tests.
authorRyan C. Gordon <icculus@icculus.org>
Wed, 21 Sep 2011 03:08:00 -0400
changeset 5965dd0c84d3d846
parent 5964 1b5c5625a6ca
child 5966 2edecf22a2e7
child 6001 3ae3d1e58d59
Moved pthread spinlock check in with the rest of the pthread tests.
configure.in
     1.1 --- a/configure.in	Wed Sep 21 02:42:25 2011 -0400
     1.2 +++ b/configure.in	Wed Sep 21 03:08:00 2011 -0400
     1.3 @@ -277,25 +277,6 @@
     1.4      fi
     1.5  fi
     1.6  
     1.7 -# Check for pthread implementation
     1.8 -AC_MSG_CHECKING(for pthread spinlock)
     1.9 -have_pthread_spinlock=no
    1.10 -
    1.11 -AC_TRY_LINK([
    1.12 -#include <pthread.h>
    1.13 -],[
    1.14 -pthread_spinlock_t a;
    1.15 -pthread_spin_trylock(&a);
    1.16 -pthread_spin_unlock(&a);
    1.17 -],[
    1.18 -have_pthread_spinlock=yes
    1.19 -])
    1.20 -AC_MSG_RESULT($have_pthread_spinlock)
    1.21 -if test x$have_pthread_spinlock = xyes; then
    1.22 -    AC_DEFINE(HAVE_PTHREAD_SPINLOCK, 1, [ ])
    1.23 -fi
    1.24 -
    1.25 -
    1.26  # Standard C sources
    1.27  SOURCES="$SOURCES $srcdir/src/*.c"
    1.28  SOURCES="$SOURCES $srcdir/src/atomic/*.c"
    1.29 @@ -1652,6 +1633,15 @@
    1.30                  AC_MSG_RESULT($have_pthread_sem)
    1.31              fi
    1.32  
    1.33 +            AC_MSG_CHECKING(for pthread_spin_trylock)
    1.34 +            AC_TRY_LINK_FUNC(pthread_spin_trylock, [
    1.35 +              has_pthread_spin_trylock=yes
    1.36 +              AC_DEFINE(HAVE_PTHREAD_SPINLOCK, 1, [ ])
    1.37 +            ],[
    1.38 +              has_pthread_spin_trylock=no
    1.39 +            ])
    1.40 +            AC_MSG_RESULT($has_pthread_spin_trylock)
    1.41 +
    1.42              # Restore the compiler flags and libraries
    1.43              CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
    1.44