cothreads
userspace threads
Cothreads are a simple user-space method for switching between
subtasks. They're based on setjmp()/longjmp() in their current form.
Cothreads are used for loop-based elements that pull data instead
of being fed with data. They can also be used to pull a specific region
of data out of their src element.
Get the current stack frame.
@ctx:
@threadnum:
@func:
@argc:
@argv:
@flags:
@sp:
@jmp:
@top_sp:
@pc:
the function that will be called when the cothread starts. The function
prototype is like a main() function, so you can do whatever you want with
it.
@argc: a main-like argument count
@argv: a main-like array of arguments
@Returns: a return code
Indicates the cothread is started.
Indicates the cothread is destroyed.
@Returns:
@ctx:
@ctx:
@Returns:
@thread:
@thread:
@func:
@argc:
@argv:
@thread:
@thread:
@thread:
@key:
@data:
@thread:
@key:
@Returns:
@thread:
@thread:
@Returns:
@thread:
@ctx:
@Returns:
@Returns:
@Returns: