#include <pthread.h>


Go to the source code of this file.
Classes | |
| struct | SIO2thread |
Enumerations | |
| enum | SIO2_THREAD_PRIORITY { SIO2_THREAD_PRIORITY_VERY_LOW = 15, SIO2_THREAD_PRIORITY_LOW = 23, SIO2_THREAD_PRIORITY_NORMAL = 31, SIO2_THREAD_PRIORITY_HIGH = 39, SIO2_THREAD_PRIORITY_VERY_HIGH = 47 } |
Functions | |
| typedef | void (SIO2threadcallback(void *)) |
| The thread callback prototype. | |
| SIO2thread * | sio2ThreadInit (void) |
| SIO2thread * | sio2ThreadFree (SIO2thread *) |
| void | sio2ThreadCreate (SIO2thread *, SIO2threadcallback *, void *, int) |
| void | sio2ThreadPlay (SIO2thread *) |
| void | sio2ThreadPause (SIO2thread *) |
| void | sio2ThreadStop (SIO2thread *) |
| void * | sio2ThreadRun (void *) |
| enum SIO2_THREAD_PRIORITY |
| void sio2ThreadCreate | ( | SIO2thread * | _SIO2thread, | |
| SIO2threadcallback * | _SIO2threadcallback, | |||
| void * | _userdata, | |||
| int | _priority | |||
| ) |
Create a new SIO2thread. By default the newly created SIO2thread will be put on SIO2_PAUSE by default, call sio2ThreadPlay to start the internal thread loop.
_SIO2thread: A valid SIO2thread pointer.
_SIO2threadcallback: A valid SIO2threadcallback function callback that will be called every thread loop.
_userdata: A user define pointer.
_priority: The priority of the SIO2thread.
References SIO2thread::_SIO2threadcallback, SIO2thread::priority, SIO2_PAUSE, SIO2_THREAD_TIMEOUT, sio2Sleep(), sio2ThreadRun(), SIO2thread::thread, SIO2thread::thread_hdl, and SIO2thread::userdata.

| SIO2thread* sio2ThreadFree | ( | SIO2thread * | _SIO2thread | ) |
Stop and free a previous initialized SIO2thread.
_SIO2thread: A valid SIO2thread pointer.
return a NUL SIO2thread pointer.
References SIO2_STOP, SIO2_THREAD_TIMEOUT, sio2Sleep(), sio2ThreadStop(), SIO2thread::state, and SIO2thread::thread.

| SIO2thread* sio2ThreadInit | ( | void | ) |
Create a new SIO2thread pointer. Please take note that SIO2threads are like SIO2sockets, their handle are not included in the global SIO2resource.
return a new SIO2thread pointer.
| void sio2ThreadPause | ( | SIO2thread * | _SIO2thread | ) |
Set the SIO2thread state to pause.
_SIO2thread: A valid SIO2thread pointer.
References SIO2_PAUSE, and SIO2thread::state.
Referenced by sio2ThreadRun().
| void sio2ThreadPlay | ( | SIO2thread * | _SIO2thread | ) |
Set the SIO2thread state to play.
_SIO2thread: A valid SIO2thread pointer.
References SIO2_PLAY, and SIO2thread::state.
| void* sio2ThreadRun | ( | void * | _ptr | ) |
The SIO2 internal thread function callback. From there the state, function callback will be handled there.
_SIO2thread: A valid SIO2thread pointer.
References SIO2thread::_SIO2threadcallback, SIO2thread::priority, SIO2_PLAY, SIO2_THREAD_TIMEOUT, sio2Sleep(), sio2ThreadPause(), SIO2thread::state, SIO2thread::thread, and SIO2thread::userdata.
Referenced by sio2ThreadCreate().

| void sio2ThreadStop | ( | SIO2thread * | _SIO2thread | ) |
Set the SIO2thread state to stop.
_SIO2thread: A valid SIO2thread pointer.
References SIO2_STOP, and SIO2thread::state.
Referenced by sio2ThreadFree().
| typedef void | ( | SIO2threadcallback(void *) | ) |
The thread callback prototype.
1.5.6