struct Current
Defined at line 1381 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 1432 of file ../../zircon/kernel/include/kernel/thread.h
MemoryAllocationState & memory_allocation_state ()
Defined at line 1436 of file ../../zircon/kernel/include/kernel/thread.h
cpu_mask_t SetCpuAffinity (cpu_mask_t affinity)
Defined at line 1440 of file ../../zircon/kernel/include/kernel/thread.h
RestrictedState * restricted_state ()
Defined at line 1449 of file ../../zircon/kernel/include/kernel/thread.h
VmAspace * active_aspace ()
Defined at line 1453 of file ../../zircon/kernel/include/kernel/thread.h
VmAspace * switch_aspace (VmAspace * aspace)
Defined at line 1455 of file ../../zircon/kernel/include/kernel/thread.h
void Dump (bool full)
Defined at line 1482 of file ../../zircon/kernel/include/kernel/thread.h
void DumpDuringPanic (bool full)
Defined at line 1483 of file ../../zircon/kernel/include/kernel/thread.h
Thread * Get ()
This is defined below, just after the Thread declaration.
Defined at line 1948 of file ../../zircon/kernel/include/kernel/thread.h
void Yield ()
Scheduler routines to be used by regular kernel code.
Defined at line 1632 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 1652 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 1673 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 950 of file ../../zircon/kernel/kernel/thread.cc
void Kill ()
Defined at line 1120 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 1963 of file ../../zircon/kernel/kernel/thread.cc
zx_status_t SleepEtc (const Deadline &deadline,Interruptibleinterruptible,zx_instant_mono_tnow)
Wait until the deadline has occurred.
If interruptible, may return early with ZX_ERR_INTERNAL_INTR_KILLED if
thread is signaled for kill.
Defined at line 1783 of file ../../zircon/kernel/kernel/thread.cc
zx_status_t Sleep (zx_instant_mono_t deadline)
Non-interruptible version of SleepEtc.
Defined at line 1838 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 1843 of file ../../zircon/kernel/kernel/thread.cc
zx_status_t SleepInterruptible (zx_instant_mono_t deadline)
Interruptible version of Sleep.
Defined at line 1849 of file ../../zircon/kernel/kernel/thread.cc
void DoSuspend ()
Transition the current thread to the THREAD_SUSPENDED state.
Defined at line 1276 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 1352 of file ../../zircon/kernel/kernel/thread.cc
void SignalPolicyException (uint32_t policy_exception_code, uint32_t policy_exception_data)
|policy_exception_code| should be a ZX_EXCP_POLICY_CODE_* value.
Defined at line 750 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 1423 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 1151 of file ../../zircon/kernel/kernel/thread.cc
void SetName (const char * name)
Change name of current thread
Defined at line 1913 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 1609 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 317 of file ../../zircon/kernel/kernel/thread.cc
zx_status_t SoftFault (vaddr_t va, uint flags)
Defined at line 321 of file ../../zircon/kernel/kernel/thread.cc
zx_status_t SoftFaultInRange (vaddr_tva,uintflags,size_tlen)
Defined at line 325 of file ../../zircon/kernel/kernel/thread.cc
zx_status_t AccessedFault (vaddr_t va)
Defined at line 330 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 2415 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 2425 of file ../../zircon/kernel/kernel/thread.cc