patch_seq_weave_cancel

Function patch_seq_weave_cancel 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn patch_seq_weave_cancel(stack: Stack) -> Stack
Expand description

Cancel a weave, releasing its resources

Stack effect: ( WeaveHandle – )

Sends a cancellation signal to the weave, causing it to exit cleanly. This is necessary to avoid resource leaks when abandoning a weave before it completes naturally.

If the weave is:

  • Waiting for first resume: exits immediately
  • Waiting inside yield: receives cancel signal and can exit
  • Already completed: no effect (signal is ignored)

§Error Handling

This function never panics (panicking in extern “C” is UB). On fatal error (null stack, type mismatch), it prints an error and aborts the process.

§Safety

Stack must have a WeaveHandle (WeaveCtx) on top