Sasha Levin | 5634bd7 | 2013-06-13 18:41:17 -0400 | [diff] [blame] | 1 | #ifndef _LIBLOCKDEP_SPINLOCK_H_ |
| 2 | #define _LIBLOCKDEP_SPINLOCK_H_ |
| 3 | |
| 4 | #include <pthread.h> |
| 5 | #include <stdbool.h> |
| 6 | |
| 7 | #define arch_spinlock_t pthread_mutex_t |
| 8 | #define __ARCH_SPIN_LOCK_UNLOCKED PTHREAD_MUTEX_INITIALIZER |
| 9 | |
| 10 | static inline void arch_spin_lock(arch_spinlock_t *mutex) |
| 11 | { |
| 12 | pthread_mutex_lock(mutex); |
| 13 | } |
| 14 | |
| 15 | static inline void arch_spin_unlock(arch_spinlock_t *mutex) |
| 16 | { |
| 17 | pthread_mutex_unlock(mutex); |
| 18 | } |
| 19 | |
| 20 | static inline bool arch_spin_is_locked(arch_spinlock_t *mutex) |
| 21 | { |
| 22 | return true; |
| 23 | } |
| 24 | |
| 25 | #endif |