mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-30 05:31:15 +00:00
9655c3b593
Original commit message from CVS: Updated the API docs.
168 lines
2.2 KiB
Text
168 lines
2.2 KiB
Text
<!-- ##### SECTION Title ##### -->
|
|
cothreads
|
|
|
|
<!-- ##### SECTION Short_Description ##### -->
|
|
userspace threads
|
|
|
|
<!-- ##### SECTION Long_Description ##### -->
|
|
<para>
|
|
Cothreads are a simple user-space method for switching between
|
|
subtasks. They're based on setjmp()/longjmp() in their current form.
|
|
</para>
|
|
|
|
<para>
|
|
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.
|
|
</para>
|
|
|
|
<!-- ##### SECTION See_Also ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
<!-- ##### MACRO COTHREAD_STACKSIZE ##### -->
|
|
<para>
|
|
The default stack size of a cothread
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### MACRO COTHREAD_MAXTHREADS ##### -->
|
|
<para>
|
|
The maximum number of cothreads we are going to support.
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### MACRO STACK_SIZE ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### MACRO CURRENT_STACK_FRAME ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### STRUCT cothread_state ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@ctx:
|
|
@threadnum:
|
|
@func:
|
|
@argc:
|
|
@argv:
|
|
@flags:
|
|
@sp:
|
|
@top_sp:
|
|
@pc:
|
|
@jmp:
|
|
|
|
<!-- ##### STRUCT cothread_context ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@threads:
|
|
@nthreads:
|
|
@current:
|
|
@data:
|
|
|
|
<!-- ##### USER_FUNCTION cothread_func ##### -->
|
|
<para>
|
|
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.
|
|
</para>
|
|
|
|
@argc: a main-like argument count
|
|
@argv: a main-like array of arguments
|
|
@Returns: a return code
|
|
|
|
|
|
<!-- ##### MACRO COTHREAD_STARTED ##### -->
|
|
<para>
|
|
Indicates the cothread is started
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION cothread_init ##### -->
|
|
<para>
|
|
</para>
|
|
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION cothread_create ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@ctx:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION cothread_setfunc ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@thread:
|
|
@func:
|
|
@argc:
|
|
@argv:
|
|
|
|
|
|
<!-- ##### FUNCTION cothread_switch ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@thread:
|
|
|
|
|
|
<!-- ##### FUNCTION cothread_getcurrent ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION cothread_main ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@ctx:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION cothread_set_data ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@thread:
|
|
@key:
|
|
@data:
|
|
|
|
|
|
<!-- ##### FUNCTION cothread_get_data ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@thread:
|
|
@key:
|
|
@Returns:
|
|
|
|
|