#[repr(u64)]pub enum ThreadControl {
Show 19 variants
Exit = 0,
Yield = 1,
SetTls = 2,
GetTls = 3,
SetUpcall = 4,
GetUpcall = 5,
ReadRegister = 6,
WriteRegister = 7,
SendMessage = 8,
ChangeState = 9,
SetTrapState = 10,
GetTrapState = 11,
SetPriority = 12,
GetPriority = 13,
SetAffinity = 14,
GetAffinity = 15,
ResumeFromUpcall = 16,
GetSelfId = 17,
GetActiveSctxId = 18,
}
Expand description
Possible Thread Control operations
Variants§
Exit = 0
Exit the thread. arg1 and arg2 should be code and location respectively, where code contains a 64-bit value to write into *location, followed by the kernel performing a thread-wake event on the memory word at location. If location is null, the write and thread-wake do not occur.
Yield = 1
Yield the thread’s CPU time now. The actual effect of this is unspecified, but it acts as a hint to the kernel that this thread does not need to run right now. The kernel, of course, is free to ignore this hint.
SetTls = 2
Set thread’s TLS pointer
GetTls = 3
Get the thread’s TLS pointer.
SetUpcall = 4
Set the thread’s upcall pointer (child threads in the same virtual address space will inherit).
GetUpcall = 5
Get the upcall pointer.
ReadRegister = 6
Read a register from the thread’s CPU state. The thread must be suspended.
WriteRegister = 7
Write a value to a register in the thread’s CPU state. The thread must be suspended.
SendMessage = 8
Send a user-defined async or sync event to the thread.
ChangeState = 9
Change the thread’s state. Allowed transitions are: running -> suspended suspended -> running running -> exited
SetTrapState = 10
Set the Trap State for the thread.
GetTrapState = 11
Get the Trap State for the thread.
SetPriority = 12
Set a thread’s priority. Threads require special permission to increase their priority.
GetPriority = 13
Get a thread’s priority.
SetAffinity = 14
Set a thread’s affinity.
GetAffinity = 15
Get a thread’s affinity.
ResumeFromUpcall = 16
Resume from an upcall.
GetSelfId = 17
Get the repr ID of the calling thread.
GetActiveSctxId = 18
Get the ID of the active security context.
Trait Implementations§
source§impl Debug for ThreadControl
impl Debug for ThreadControl
source§impl From<ThreadControl> for u64
impl From<ThreadControl> for u64
source§fn from(enum_value: ThreadControl) -> Self
fn from(enum_value: ThreadControl) -> Self
source§impl From<u64> for ThreadControl
impl From<u64> for ThreadControl
source§impl FromPrimitive for ThreadControl
impl FromPrimitive for ThreadControl
source§impl Ord for ThreadControl
impl Ord for ThreadControl
source§fn cmp(&self, other: &ThreadControl) -> Ordering
fn cmp(&self, other: &ThreadControl) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for ThreadControl
impl PartialEq for ThreadControl
source§impl PartialOrd for ThreadControl
impl PartialOrd for ThreadControl
impl Eq for ThreadControl
impl StructuralPartialEq for ThreadControl
Auto Trait Implementations§
impl Freeze for ThreadControl
impl ObjSafe for ThreadControl
impl RefUnwindSafe for ThreadControl
impl Send for ThreadControl
impl Sync for ThreadControl
impl Unpin for ThreadControl
impl UnwindSafe for ThreadControl
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.