Skip to main content

thread_create

Function thread_create 

Source
pub fn thread_create(
    entry: usize,
    stack_top: usize,
    arg0: usize,
    tls_base: usize,
) -> Result<usize>
Expand description

Create a new userspace thread in the current process.

  • entry: user function address (RIP)
  • stack_top: user stack top (RSP), 16-byte aligned
  • arg0: first argument passed in RDI
  • tls_base: optional FS base for thread-local storage

Returns the new thread TID.