Sample Header Ad - 728x90

A question about spin locks

0 votes
1 answer
156 views
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!
Asked by Athanasios Margaris (129 rep)
Aug 17, 2021, 12:09 PM
Last activity: Aug 17, 2021, 12:18 PM