[Kernel] Add null-safe XThread::TryGetCurrentThread() accessor
The additive event_log extraction tracer needs a current-thread lookup that returns nullptr instead of asserting when called from boot code before any XThread exists (GetCurrentThread asserts on non-guest threads). New read-only static accessor over the thread-local; no behaviour change. Fixes the native Linux build of the phase-a args/file.read tracer. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -117,6 +117,8 @@ XThread* XThread::GetCurrentThread() {
|
||||
return thread;
|
||||
}
|
||||
|
||||
XThread* XThread::TryGetCurrentThread() { return current_xthread_tls_; }
|
||||
|
||||
uint32_t XThread::GetCurrentThreadHandle() {
|
||||
XThread* thread = XThread::GetCurrentThread();
|
||||
return thread->handle();
|
||||
|
||||
Reference in New Issue
Block a user