patch_seq_strand_spawn_with_base

Function patch_seq_strand_spawn_with_base 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn patch_seq_strand_spawn_with_base( entry: extern "C" fn(Stack) -> Stack, initial_stack: Stack, stack_base: Stack, ) -> i64
Expand description

Spawn a strand (coroutine) with initial stack and explicit stack base

This variant allows setting the STACK_BASE for the spawned strand, which is required for the child to perform operations like clone_stack (nested spawn).

ยงSafety

  • entry must be a valid function pointer that can safely execute on any thread
  • initial_stack must be a valid pointer to a StackValue array
  • stack_base must be the base of the stack (or null to skip setting STACK_BASE)
  • The caller transfers ownership of initial_stack to the coroutine
  • Returns a unique strand ID (positive integer)