Hi,
I am reading the source code of spinlock and have a question about
it. The spinlock is defined as:
typedef struct {
volatile unsigned int slock;
#ifdef CONFIG_PREEMPT
unsigned int break_lock;
#endif
} spinlock_t;
When 'break_lock' is one, it indicates that there are other tasks
waiting the spinlock. If so, these tasks should be running on other
CPUs. In other words, there are definitely no other tasks waiting the
lock, which are on the same CPU on which the spinlock owner is runing,
because the owner has disabled the kernel preemption. That is, there
are no other local tasks which can set 'break_lock' to 1. Therefore, I
think whether or not 'break_lock' is defined has nothing to do with
CONFIG_PREEMPT. May be a misunderstanding. Any explanation?
_______________________________________________
Kernelnewbies mailing list
[email protected]
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies