Commit 8f92249a authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Fix previous commit

parent bafe9aa0
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
# define LIBVLC_USE_PTHREAD 1 # define LIBVLC_USE_PTHREAD 1
# define _APPLE_C_SOURCE 1 /* Proper pthread semantics on OSX */ # define _APPLE_C_SOURCE 1 /* Proper pthread semantics on OSX */
# include <unistd.h> /* _POSIX_SPIN_LOCKS */
# include <pthread.h> # include <pthread.h>
/* Needed for pthread_cond_timedwait */ /* Needed for pthread_cond_timedwait */
# include <errno.h> # include <errno.h>
......
...@@ -813,7 +813,7 @@ typedef struct ...@@ -813,7 +813,7 @@ typedef struct
*/ */
static inline int vlc_spin_init (vlc_spinlock_t *spin) static inline int vlc_spin_init (vlc_spinlock_t *spin)
{ {
return pthread_spin_init (&spin, PTHREAD_PROCESS_PRIVATE); return pthread_spin_init (&spin->spin, PTHREAD_PROCESS_PRIVATE);
} }
/** /**
...@@ -842,7 +842,12 @@ static inline int vlc_spin_destroy (vlc_spinlock_t *spin) ...@@ -842,7 +842,12 @@ static inline int vlc_spin_destroy (vlc_spinlock_t *spin)
#else #else
/* Fallback to plain mutexes if spinlocks are not available */ /* Fallback to plain mutexes if spinlocks are not available */
typedef vlc_mutex_t vlc_spinlock_t; typedef vlc_mutex_t vlc_spinlock_t;
# define vlc_spin_init vlc_mutex_init
static inline int vlc_spin_init (vlc_spinlock_t *spin)
{
return vlc_mutex_init (NULL, spin);
}
# define vlc_spin_lock vlc_mutex_lock # define vlc_spin_lock vlc_mutex_lock
# define vlc_spin_unlock vlc_mutex_unlock # define vlc_spin_unlock vlc_mutex_unlock
# define vlc_spin_destroy vlc_mutex_destroy # define vlc_spin_destroy vlc_mutex_destroy
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment