diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake index 2cd09e6ff..08347ece2 100644 --- a/cmake/sdlchecks.cmake +++ b/cmake/sdlchecks.cmake @@ -753,13 +753,6 @@ macro(CheckPTHREAD) endif(HAVE_PTHREADS_SEM) endif(PTHREADS_SEM) - check_c_source_compiles(" - #include - int main(int argc, char** argv) { - pthread_spin_trylock(NULL); - return 0; - }" HAVE_PTHREAD_SPINLOCK) - check_c_source_compiles(" #include #include diff --git a/configure.in b/configure.in index d4c537eea..3c87ea754 100644 --- a/configure.in +++ b/configure.in @@ -2384,15 +2384,6 @@ AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]]) AC_MSG_RESULT($have_sem_timedwait) 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) - AC_CHECK_HEADER(pthread_np.h, have_pthread_np_h=yes, have_pthread_np_h=no, [ #include ]) if test x$have_pthread_np_h = xyes; then AC_DEFINE(HAVE_PTHREAD_NP_H, 1, [ ]) diff --git a/include/SDL_config.h.cmake b/include/SDL_config.h.cmake index 2c9ce6c6c..9bcf6e909 100644 --- a/include/SDL_config.h.cmake +++ b/include/SDL_config.h.cmake @@ -46,7 +46,6 @@ #cmakedefine HAVE_GCC_ATOMICS @HAVE_GCC_ATOMICS@ #cmakedefine HAVE_GCC_SYNC_LOCK_TEST_AND_SET @HAVE_GCC_SYNC_LOCK_TEST_AND_SET@ -#cmakedefine HAVE_PTHREAD_SPINLOCK @HAVE_PTHREAD_SPINLOCK@ #cmakedefine HAVE_DXGI_H @HAVE_DXGI_H@ diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in index ea25249ac..145a7b772 100644 --- a/include/SDL_config.h.in +++ b/include/SDL_config.h.in @@ -49,7 +49,6 @@ #endif #undef HAVE_GCC_ATOMICS #undef HAVE_GCC_SYNC_LOCK_TEST_AND_SET -#undef HAVE_PTHREAD_SPINLOCK #undef HAVE_DDRAW_H #undef HAVE_DINPUT_H diff --git a/premake/Linux/SDL_config_premake.h b/premake/Linux/SDL_config_premake.h index f76594a98..01a135800 100644 --- a/premake/Linux/SDL_config_premake.h +++ b/premake/Linux/SDL_config_premake.h @@ -50,7 +50,6 @@ #endif #define HAVE_GCC_ATOMICS 1 /* #undef HAVE_GCC_SYNC_LOCK_TEST_AND_SET */ -#define HAVE_PTHREAD_SPINLOCK 1 /* Comment this if you want to build without any C library requirements */ #define HAVE_LIBC 1 diff --git a/premake/config/SDL_config_cygwin.template.h b/premake/config/SDL_config_cygwin.template.h index 46d6f36b6..651989eb7 100644 --- a/premake/config/SDL_config_cygwin.template.h +++ b/premake/config/SDL_config_cygwin.template.h @@ -46,7 +46,6 @@ #define SIZEOF_VOIDP 4 #define HAVE_GCC_ATOMICS 1 /* #undef HAVE_GCC_SYNC_LOCK_TEST_AND_SET */ -#define HAVE_PTHREAD_SPINLOCK 1 /* Comment this if you want to build without any C library requirements */ #define HAVE_LIBC 0 diff --git a/premake/config/SDL_config_linux.template.h b/premake/config/SDL_config_linux.template.h index 7560a880b..8a62fdb99 100644 --- a/premake/config/SDL_config_linux.template.h +++ b/premake/config/SDL_config_linux.template.h @@ -50,7 +50,6 @@ #endif #define HAVE_GCC_ATOMICS 1 /* #undef HAVE_GCC_SYNC_LOCK_TEST_AND_SET */ -#define HAVE_PTHREAD_SPINLOCK 1 /* Comment this if you want to build without any C library requirements */ #define HAVE_LIBC 1 diff --git a/src/atomic/SDL_spinlock.c b/src/atomic/SDL_spinlock.c index 11aff019b..29b5190e5 100644 --- a/src/atomic/SDL_spinlock.c +++ b/src/atomic/SDL_spinlock.c @@ -89,10 +89,6 @@ SDL_AtomicTryLock(SDL_SpinLock *lock) /* Maybe used for PowerPC, but the Intel asm or gcc atomics are favored. */ return OSAtomicCompareAndSwap32Barrier(0, 1, lock); -#elif HAVE_PTHREAD_SPINLOCK - /* pthread instructions */ - return (pthread_spin_trylock(lock) == 0); - #elif defined(__SOLARIS__) && defined(_LP64) /* Used for Solaris with non-gcc compilers. */ return (SDL_bool) ((int) atomic_cas_64((volatile uint64_t*)lock, 0, 1) == 0); @@ -126,9 +122,6 @@ SDL_AtomicUnlock(SDL_SpinLock *lock) #elif HAVE_GCC_ATOMICS || HAVE_GCC_SYNC_LOCK_TEST_AND_SET __sync_lock_release(lock); -#elif HAVE_PTHREAD_SPINLOCK - pthread_spin_unlock(lock); - #elif defined(__SOLARIS__) /* Used for Solaris when not using gcc. */ *lock = 0;