That's bogus on UP (spin_is_locked always returns 0).
I think it would be reasonably nice to have something like
spin_lock_held(spinlock_t *lock);
that returns 1 for UP and spin_is_locked(lock) for SMP - basically
foo()
{
if (!spin_lock_held(&foo_lock))
BUG();
...
}
looks to me like it'll avoid errors more effectively than
/* Call with foo_lock held */
foo()
{
...
}
Philipp Rumpf
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/