I'm trying to understand how to use the Linux kernel spinlocks. From reading the header, I think I have to first declare one and initialize it like this with spin_lock_init
:
spinlock_t xxx_lock;
spin_lock_init(&xxx_lock);
and then I can lock and unlock it with spin_lock
and spin_unlock
.
I hope what I understood until here is correct.
But what do I have to do to "invert" the spin_lock_init
? How do I destroy the spinlock?