I'm new to Kernel programming and programming with locks.
Is it safe to lock and unlock a spinlock in different functions? I am doing this to synchronize the code flow.
Also, is it safe to use spinlock (lock & unlock) in __schedule()? Is it safe to keep the scheduler waiting to acquire a lock?
Thanks in advance.