#include <cybergarage/typedef.h>
#include <cybergarage/util/clist.h>
#include <cybergarage/util/ccond.h>
#include <cybergarage/util/ctime.h>
#include <pthread.h>
#include <signal.h>
Define Documentation
| #define CG_THREAD_MIN_SLEEP 1000 |
| #define cg_thread_next |
( |
|
thread | ) |
(CgThread *)cg_list_next((CgList *)thread) |
| #define cg_thread_remove |
( |
|
thread | ) |
cg_list_remove((CgList *)thread) |
| #define cg_threadlist_add |
( |
|
threadList, |
|
|
|
thread |
|
) |
| cg_list_add((CgList *)threadList, (CgList *)thread) |
Add a thread into a thread list
- Parameters:
-
| threadList | The thread list in question |
| thread | The thread to add to the list |
Clear the contents of a thread list
- Parameters:
-
| threadList | Thread list in question |
| #define cg_threadlist_gets |
( |
|
threadList | ) |
(CgThread *)cg_list_next((CgList *)threadList) |
Get the first actual item from a thread list to use as an iterator
- Parameters:
-
| threadList | The thread list in question |
| #define cg_threadlist_remove |
( |
|
thread | ) |
cg_list_remove((CgList *)thread) |
Remove a thread from thread list
- Parameters:
-
| threadList | The thread list in question |
| thread | The thread to be removed |
| #define cg_threadlist_size |
( |
|
threadList | ) |
cg_list_size((CgList *)threadList) |
Get the size of a thread list
- Parameters:
-
| threadList | The thread list in question |
Typedef Documentation
Prototype for the threads' worker functions
The generic wrapper struct for CyberLinkC's threads.
This wrapper has been created to enable 100% code compatibility between different platforms (Linux, Win32 etc..)
Function Documentation
Stop and destroy a thread.
- Parameters:
-
| void* cg_thread_getuserdata |
( |
CgThread * |
thread | ) |
|
Get the user data pointer
- Parameters:
-
| thread | Thread from which to get the pointer |
Check if a thread has been started
- Parameters:
-
Get a self reference to thread.
Set the thread's worker function.
- Parameters:
-
| thread | Thread struct |
| actionFunc | Function pointer to set as the worker function |
| void cg_thread_setuserdata |
( |
CgThread * |
thread, |
|
|
void * |
data |
|
) |
| |
Set the user data pointer
- Parameters:
-
| thread | Thread struct |
| data | Pointer to user data |
Start a thread (must be created first with ch_thread_new())
- Parameters:
-
Stop a running thread.
- Parameters:
-
Stop the running thread and signal the given CGCond.
Destroy a thread list
- Parameters:
-
| threadList | The thread list in question |
Create a new thread list
- Returns:
- Thread list
Start all threads in the thread list
- Parameters:
-
| threadList | The thread list in question |
Stop all threads in the thread list
- Parameters:
-
| threadList | The thread list in question |