struct Current
Defined at line 1363 of file ../../zircon/kernel/include/kernel/thread.h
All of these operations implicitly operate on the current thread.
Public Methods
PreemptionState & preemption_state ()
Defined at line 1414 of file ../../zircon/kernel/include/kernel/thread.h
MemoryAllocationState & memory_allocation_state ()
Defined at line 1418 of file ../../zircon/kernel/include/kernel/thread.h
RestrictedState * restricted_state ()
Defined at line 1427 of file ../../zircon/kernel/include/kernel/thread.h
VmAspace * active_aspace ()
Defined at line 1431 of file ../../zircon/kernel/include/kernel/thread.h
VmAspace * switch_aspace (VmAspace * aspace)
Defined at line 1433 of file ../../zircon/kernel/include/kernel/thread.h
void Dump (bool full)
Defined at line 1460 of file ../../zircon/kernel/include/kernel/thread.h
void DumpDuringPanic (bool full)
Defined at line 1461 of file ../../zircon/kernel/include/kernel/thread.h
Thread * Get ()
This is defined below, just after the Thread declaration.
Defined at line 1911 of file ../../zircon/kernel/include/kernel/thread.h
void Yield ()
Yield the cpu to another thread
This function places the current thread at the end of the run queue
and yields the cpu to another waiting thread (if any.)
This function will return at some later time. Possibly immediately if
no other threads are waiting to execute.
Defined at line 1610 of file ../../zircon/kernel/kernel/thread.cc
void Preempt ()
Preempt the current thread from an interrupt
This function places the current thread at the head of the run
queue and then yields the cpu to another thread.
Defined at line 1630 of file ../../zircon/kernel/kernel/thread.cc
void Reschedule ()
Reevaluate the run queue on the current cpu.
This function places the current thread at the head of the run
queue and then yields the cpu to another thread. Similar to
thread_preempt, but intended to be used at non interrupt context.
Defined at line 1651 of file ../../zircon/kernel/kernel/thread.cc
void Exit (int retcode)
Terminate the current thread
Current thread exits with the specified return code.
This function does not return.
Defined at line 937 of file ../../zircon/kernel/kernel/thread.cc
void Kill ()
Defined at line 1107 of file ../../zircon/kernel/kernel/thread.cc
void BecomeIdle ()
Become an idle thread
This function marks the current thread as the idle thread -- the one which
executes when there is nothing else to do. This function does not return.
This thread is called once at boot on the first cpu.
Defined at line 1941 of file ../../zircon/kernel/kernel/thread.cc
zx_status_t SleepEtc (const Deadline & deadline, Interruptible interruptible, zx_instant_mono_t now)
Put thread to sleep; deadline specified in ns
This function puts the current thread to sleep until the specified
deadline has occurred.
Note that this function could continue to sleep after the specified deadline
if other threads are running. When the deadline occurrs, this thread will
be placed at the head of the run queue.
interruptible argument allows this routine to return early if the thread was signaled
for something.
Defined at line 1761 of file ../../zircon/kernel/kernel/thread.cc
zx_status_t Sleep (zx_instant_mono_t deadline)
Non-interruptible version of SleepEtc.
Defined at line 1816 of file ../../zircon/kernel/kernel/thread.cc
zx_status_t SleepRelative (zx_duration_mono_t delay)
Non-interruptible relative delay version of Sleep.
Defined at line 1821 of file ../../zircon/kernel/kernel/thread.cc
zx_status_t SleepInterruptible (zx_instant_mono_t deadline)
Interruptible version of Sleep.
Defined at line 1827 of file ../../zircon/kernel/kernel/thread.cc
void DoSuspend ()
Transition the current thread to the THREAD_SUSPENDED state.
Defined at line 1263 of file ../../zircon/kernel/kernel/thread.cc
void DoSampleStack (GeneralRegsSource source, void * gregs)
Write the current thread's stack to the assigned sampler buffers
Defined at line 1339 of file ../../zircon/kernel/kernel/thread.cc
void SignalPolicyException (uint32_t policy_exception_code, uint32_t policy_exception_data)
Signal an exception on the current thread, to be handled when the
current syscall exits. Unlike other signals, this is synchronous, in
the sense that a thread signals itself. This exists primarily so that
we can unwind the stack in order to get the state of userland's
callee-saved registers at the point where userland invoked the
syscall.
Defined at line 737 of file ../../zircon/kernel/kernel/thread.cc
void ProcessPendingSignals (GeneralRegsSource source, void * gregs)
Process any pending thread signals.
This method may never return if the thread has a pending kill signal.
Interrupt state - This method modifies interrupt state. It is critical that this method be
called with interrupts disabled to eliminate a "lost wakeup" race condition. While
interrupts must be disabled prior to call this method, the method may re-enable them during
the processing of certain signals. This method guarantees that if it does return, it will do
so with interrupts disabled.
Defined at line 1410 of file ../../zircon/kernel/kernel/thread.cc
void MigrateToCpu (cpu_num_t target_cpuid)
Migrates the current thread to the CPU identified by target_cpu.
Defined at line 1138 of file ../../zircon/kernel/kernel/thread.cc
void SetName (const char * name)
Change name of current thread
Defined at line 1891 of file ../../zircon/kernel/kernel/thread.cc
bool CheckForRestrictedKick ()
If a restricted kick is pending on this thread, clear it and return true.
Otherwise return false.
Must be called with interrupts disabled.
Defined at line 1587 of file ../../zircon/kernel/kernel/thread.cc
zx_status_t PageFault (vaddr_t va, uint flags)
These three functions handle faults on the address space containing va. If there is no
aspace that contains va, or we don't have access to it, a ZX_ERR_NOT_FOUND is returned.
Calling any of these methods on a pure kernel thread (i.e. one without an associated
`ThreadDispatcher`) is a programming error.
May block on page requests and must be called without locks held.
Defined at line 312 of file ../../zircon/kernel/kernel/thread.cc
zx_status_t SoftFault (vaddr_t va, uint flags)
Defined at line 316 of file ../../zircon/kernel/kernel/thread.cc
zx_status_t SoftFaultInRange (vaddr_t va, uint flags, size_t len)
Defined at line 320 of file ../../zircon/kernel/kernel/thread.cc
zx_status_t AccessedFault (vaddr_t va)
Defined at line 325 of file ../../zircon/kernel/kernel/thread.cc
void GetBacktrace (Backtrace & out_bt)
Generate a backtrace for the calling thread.
|out_bt| will be reset() prior to be filled in and if a backtrace cannot
be obtained, it will be left empty.
Defined at line 2349 of file ../../zircon/kernel/kernel/thread.cc
void GetBacktrace (vaddr_t fp, Backtrace & out_bt)
Generate a backtrace for the calling thread starting at frame pointer |fp|.
|out_bt| will be reset() prior to be filled in and if a backtrace cannot
be obtained, it will be left empty.
Defined at line 2359 of file ../../zircon/kernel/kernel/thread.cc