Cyber Garage Portable Runtime (CGPR) for C
thread.h File Reference
#include <cgpr/util/list.h>
#include <cgpr/util/time.h>
#include <pthread.h>
#include <signal.h>

Data Structures

struct  _CGThread
 The generic wrapper struct for mUPnP's threads. More...
 

Macros

#define CG_THREAD_MIN_SLEEP   200
 
#define cg_thread_next(thread)
 
#define cg_thread_remove(thread)
 
#define cg_threadlist_clear(threadList)
 
#define cg_threadlist_size(threadList)
 
#define cg_threadlist_gets(threadList)
 
#define cg_threadlist_add(threadList, thread)
 
#define cg_threadlist_remove(thread)
 

Typedefs

typedef struct _CGThread CGThread
 
typedef struct _CGThread CGThreadList
 
typedef void(* CG_THREAD_FUNC) (CGThread *)
 

Functions

CGThreadcg_thread_new (void)
 
bool cg_thread_delete (CGThread *thread)
 
bool cg_thread_start (CGThread *thread)
 
bool cg_thread_stop (CGThread *thread)
 
bool cg_thread_restart (CGThread *thread)
 
bool cg_thread_isrunnable (CGThread *thread)
 
bool cg_thread_isrunning (CGThread *thread)
 
void cg_thread_setaction (CGThread *thread, CG_THREAD_FUNC actionFunc)
 
void cg_thread_setuserdata (CGThread *thread, void *data)
 
void * cg_thread_getuserdata (CGThread *thread)
 
CGThreadListcg_threadlist_new (void)
 
void cg_threadlist_delete (CGThreadList *threadList)
 
bool cg_threadlist_start (CGThreadList *threadList)
 
bool cg_threadlist_stop (CGThreadList *threadList)
 

Macro Definition Documentation

◆ CG_THREAD_MIN_SLEEP

#define CG_THREAD_MIN_SLEEP   200

◆ cg_thread_next

#define cg_thread_next ( thread)
Value:
CGList * cg_list_next(CGList *list)
Definition list.c:216
The generic list interface in mUPnP.
Definition list.h:69
The generic wrapper struct for mUPnP's threads.
Definition thread.h:46

◆ cg_thread_remove

#define cg_thread_remove ( thread)
Value:
bool cg_list_remove(CGList *list)
Definition list.c:131

◆ cg_threadlist_add

#define cg_threadlist_add ( threadList,
thread )
Value:
cg_list_add((CGList*)threadList, (CGList*)thread)
bool cg_list_add(CGList *headList, CGList *list)
Definition list.c:114

◆ cg_threadlist_clear

#define cg_threadlist_clear ( threadList)
Value:
cg_list_clear((CGList*)threadList, \
bool cg_thread_delete(CGThread *thread)
Definition thread.c:94
bool cg_list_clear(CGList *headList, CG_LIST_DESTRUCTORFUNC dstructorFunc)
Definition list.c:234
void(* CG_LIST_DESTRUCTORFUNC)(void *)
Definition list.h:42

◆ cg_threadlist_gets

#define cg_threadlist_gets ( threadList)
Value:
(CGThread*)cg_list_next((CGList*)threadList)

◆ cg_threadlist_remove

#define cg_threadlist_remove ( thread)
Value:

◆ cg_threadlist_size

#define cg_threadlist_size ( threadList)
Value:
cg_list_size((CGList*)threadList)
size_t cg_list_size(CGList *headList)
Definition list.c:55

Typedef Documentation

◆ CG_THREAD_FUNC

typedef void(* CG_THREAD_FUNC) (CGThread *)

◆ CGThread

typedef struct _CGThread CGThread

◆ CGThreadList

typedef struct _CGThread CGThreadList

Function Documentation

◆ cg_thread_delete()

bool cg_thread_delete ( CGThread * thread)

◆ cg_thread_getuserdata()

void * cg_thread_getuserdata ( CGThread * thread)

◆ cg_thread_isrunnable()

bool cg_thread_isrunnable ( CGThread * thread)

◆ cg_thread_isrunning()

bool cg_thread_isrunning ( CGThread * thread)

◆ cg_thread_new()

CGThread * cg_thread_new ( void )

◆ cg_thread_restart()

bool cg_thread_restart ( CGThread * thread)

◆ cg_thread_setaction()

void cg_thread_setaction ( CGThread * thread,
CG_THREAD_FUNC actionFunc )

◆ cg_thread_setuserdata()

void cg_thread_setuserdata ( CGThread * thread,
void * data )

◆ cg_thread_start()

bool cg_thread_start ( CGThread * thread)

◆ cg_thread_stop()

bool cg_thread_stop ( CGThread * thread)

◆ cg_threadlist_delete()

void cg_threadlist_delete ( CGThreadList * threadList)

◆ cg_threadlist_new()

CGThreadList * cg_threadlist_new ( void )

◆ cg_threadlist_start()

bool cg_threadlist_start ( CGThreadList * threadList)

◆ cg_threadlist_stop()

bool cg_threadlist_stop ( CGThreadList * threadList)