Ashet OS

namespace: ashet.process.thread

Types

System Calls

syscall yield()

Returns control to the scheduler. Returns when the scheduler schedules the process again.

syscall exit(in exit_code: process.ExitCode) noreturn

Terminates the current thread.

syscall join(in _param0: Thread, out exit_code: process.ExitCode)

Waits for the thread to exit and returns its return code.

syscall spawn(in function: process.thread.ThreadFunction, in arg: ?anyptr, in stack_size: usize, out thread: Thread)

Spawns a new thread with function passing arg to it. If stack_size is not 0, will create a stack with the given size.

syscall kill(in target: Thread, in exit_code: process.ExitCode)

Kills the given thread with exit_code.