In studying the spin lock synchronization mechanism, i noticed that for each function there is also a corresponding macro, for example for spin_lock there is a function
static __always_inline void spin_lock(spinlock_t *lock) {
raw_spin_lock(&lock->rlock); }
and the macro
#define spin_lock(x) pthread_mutex_lock(x)
Why there are two different definitions and in which circumstances it is used each one of them? Thanks a lot!