#[repr(u64)]pub enum ThreadControl {
Show 20 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,
SetActiveSctxId = 19,
}
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.
SetActiveSctxId = 19
Set the ID of the active security context.