Kernel: Make spinlocks more safe

Kernel now makes sure thread is not holding any spinlocks when it tries
to lock a mutex or yield. Spinlocks are supposed to be only used for
short times without the possibility of yielding
This commit is contained in:
2025-05-30 21:59:07 +03:00
parent 9f4b451501
commit 6542a037df
7 changed files with 72 additions and 34 deletions

View File

@@ -140,6 +140,8 @@ namespace Kernel
pid_t Thread::current_tid()
{
if (Processor::count() == 0)
return 0;
return Processor::scheduler().current_tid();
}