我正在研究 raw_spinlock
结构体,它在 /usr/src/linux/include/linux/spinlock_types.h
中:
typedef struct raw_spinlock {
arch_spinlock_t raw_lock;
#ifdef CONFIG_GENERIC_LOCKBREAK
unsigned int break_lock;
#endif
#ifdef CONFIG_DEBUG_SPINLOCK
unsigned int magic, owner_cpu;
void *owner;
#endif
#ifdef CONFIG_DEBUG_LOCK_ALLOC
struct lockdep_map dep_map;
#endif
} raw_spinlock_t;
我认为raw_lock
是一种依赖于架构的锁,而dep_map
则是一种避免死锁的数据结构,但是break_lock
、magic
、owner_cpu
和*owner
是什么意思呢?