1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
7 <!-- ##### SECTION Long_Description ##### -->
9 Cothreads are a simple user-space method for switching between
10 subtasks. They're based on setjmp()/longjmp() in their current form.
14 Cothreads are used for loop-based elements that pull data instead
15 of being fed with data. They can also be used to pull a specific region
16 of data out of their src element.
19 <!-- ##### SECTION See_Also ##### -->
24 <!-- ##### MACRO CURRENT_STACK_FRAME ##### -->
26 Get the current stack frame.
31 <!-- ##### STRUCT cothread_state ##### -->
47 <!-- ##### STRUCT cothread_context ##### -->
53 <!-- ##### USER_FUNCTION cothread_func ##### -->
55 the function that will be called when the cothread starts. The function
56 prototype is like a main() function, so you can do whatever you want with
60 @argc: a main-like argument count
61 @argv: a main-like array of arguments
62 @Returns: a return code
65 <!-- ##### MACRO COTHREAD_STARTED ##### -->
67 Indicates the cothread is started.
72 <!-- ##### FUNCTION cothread_init ##### -->
79 <!-- ##### FUNCTION cothread_create ##### -->
88 <!-- ##### FUNCTION cothread_setfunc ##### -->
99 <!-- ##### FUNCTION cothread_switch ##### -->
107 <!-- ##### FUNCTION cothread_getcurrent ##### -->
115 <!-- ##### FUNCTION cothread_main ##### -->
124 <!-- ##### FUNCTION cothread_set_data ##### -->
134 <!-- ##### FUNCTION cothread_get_data ##### -->
144 <!-- ##### FUNCTION cothread_unlock ##### -->
152 <!-- ##### FUNCTION cothread_current_main ##### -->
160 <!-- ##### FUNCTION cothread_lock ##### -->
168 <!-- ##### FUNCTION cothread_trylock ##### -->