mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 08:24:32 -08:00
[util] Add thread id to kernel spinlocks
Expose a function __current_thread_id() and use it to record the thread id on a spinlock waiter when called from the kernel.
This commit is contained in:
@@ -180,3 +180,10 @@ thread::create_idle_thread(process &kernel, uintptr_t rsp0)
|
||||
}
|
||||
|
||||
} // namespace obj
|
||||
|
||||
uint32_t
|
||||
__current_thread_id()
|
||||
{
|
||||
cpu_data &cpu = current_cpu();
|
||||
return cpu.thread ? cpu.thread->obj_id() : -1u;
|
||||
}
|
||||
|
||||
@@ -207,3 +207,5 @@ private:
|
||||
};
|
||||
|
||||
} // namespace obj
|
||||
|
||||
extern "C" uint32_t __current_thread_id();
|
||||
|
||||
Reference in New Issue
Block a user