Skip to main content

Module thread

Module thread 

Source
Expand description

ArceOS ownership and trait-FFI glue for the OS-independent task system.

Structs§

AddressSpaceCpuState
Shared CPU-footprint state for one hardware page-table root.
AddressSpaceSwitchProof
Evidence that this CPU has replaced its previous hardware root.
PreparedThread
Scheduler thread whose resources and registry identity exist but which is not yet runnable.
SchedulerAddressSpaceActivation
An inline reservation, subsequently owned by the CPU that installs it.
StagedThread
Scheduler thread placed on a run queue but not yet activated by its OS.
TaskAddressSpace
Move-only runtime token for one user address space.
ThreadOsExtensionBorrow
OS extension borrowed through the runtime’s outer scheduler extension.
ThreadOsExtensionLease
OS extension lease for current-thread lookups without an existing handle.

Traits§

SchedulerAddressSpaceOwner
Preallocated MM accounting retained by one CPU activation.
UserAddressSpaceOwner
OS ownership held by a runtime task token until its last CPU lease drains.

Functions§

current_os_extension
Leases the current thread’s composed OS extension.
default_task_stack_size
Returns the kernel stack size used by ordinary runtime threads.
detach_current_address_space
Detaches the running user task from its address space before exit publication, matching Linux exit_mm ordering.
exit_current
Stores the exit code, marks the current thread exited, and switches away.
join_thread
Waits for an exited thread and returns its exit code.
prepare_raw
Creates a scheduler-owned kernel thread without making it runnable.
prepare_raw_with_extension_in_address_space_and_scheduler_state
Prepares a user thread without making it runnable.
reset_current_user_fp_state
Resets the current task’s user FPU image during a successful executable replacement.
spawn_raw
Creates a scheduler-owned kernel thread and enqueues it on the current CPU.
spawn_raw_with_affinity
Creates a scheduler-owned kernel thread with pre-publication affinity.
spawn_raw_with_extension
Creates a kernel thread while retaining one OS-specific extension.
spawn_raw_with_extension_and_affinity
Creates a kernel thread with an OS extension and pre-publication affinity.
spawn_raw_with_extension_in_address_space
Creates a scheduler thread whose architecture context retains a user page table.
spawn_raw_with_extension_in_address_space_and_policy
Prepares a user thread with its scheduler state installed before publication.
spawn_raw_with_policy_and_affinity
Creates a scheduler-owned kernel service thread with policy and affinity installed before run-queue publication.
switch_current_address_space
Replaces the running user task’s owning address-space token.
thread_os_extension
Borrows the OS extension composed inside a runtime-owned thread record.
wait_thread
Waits for a thread to finish executing without consuming its owning handle.