mUPnP for C
|
#include <mupnp/typedef.h>
#include <mupnp/util/list.h>
#include <mupnp/util/cond.h>
#include <mupnp/util/time.h>
#include <pthread.h>
#include <signal.h>
Data Structures | |
struct | _mUpnpThread |
The generic wrapper struct for mUPnP's threads. More... | |
Macros | |
#define | MUPNP_THREAD_MIN_SLEEP 1000 |
#define | mupnp_thread_next(thread) |
#define | mupnp_thread_remove(thread) |
#define | mupnp_threadlist_clear(threadList) |
#define | mupnp_threadlist_size(threadList) |
#define | mupnp_threadlist_gets(threadList) |
#define | mupnp_threadlist_add(threadList, thread) |
#define | mupnp_threadlist_remove(thread) |
Typedefs | |
typedef struct _mUpnpThread | mUpnpThread |
The generic wrapper struct for mUPnP's threads. | |
typedef struct _mUpnpThread | mUpnpThreadList |
typedef void(* | MUPNP_THREAD_FUNC) (mUpnpThread *) |
Functions | |
mUpnpThread * | mupnp_thread_new (void) |
mUpnpThread * | mupnp_thread_self (void) |
bool | mupnp_thread_delete (mUpnpThread *thread) |
bool | mupnp_thread_start (mUpnpThread *thread) |
bool | mupnp_thread_stop (mUpnpThread *thread) |
bool | mupnp_thread_stop_with_cond (mUpnpThread *thread, mUpnpCond *cond) |
bool | mupnp_thread_restart (mUpnpThread *thread) |
bool | mupnp_thread_isrunnable (mUpnpThread *thread) |
void | mupnp_thread_setaction (mUpnpThread *thread, MUPNP_THREAD_FUNC actionFunc) |
void | mupnp_thread_setuserdata (mUpnpThread *thread, void *data) |
void * | mupnp_thread_getuserdata (mUpnpThread *thread) |
mUpnpThreadList * | mupnp_threadlist_new (void) |
void | mupnp_threadlist_delete (mUpnpThreadList *threadList) |
bool | mupnp_threadlist_start (mUpnpThreadList *threadList) |
bool | mupnp_threadlist_stop (mUpnpThreadList *threadList) |
#define MUPNP_THREAD_MIN_SLEEP 1000 |
#define mupnp_thread_next | ( | thread | ) |
#define mupnp_thread_remove | ( | thread | ) |
#define mupnp_threadlist_add | ( | threadList, | |
thread ) |
Add a thread into a thread list
threadList | The thread list in question |
thread | The thread to add to the list |
#define mupnp_threadlist_clear | ( | threadList | ) |
Clear the contents of a thread list
threadList | Thread list in question |
#define mupnp_threadlist_gets | ( | threadList | ) |
Get the first actual item from a thread list to use as an iterator
threadList | The thread list in question |
#define mupnp_threadlist_remove | ( | thread | ) |
Remove a thread from thread list
threadList | The thread list in question |
thread | The thread to be removed |
#define mupnp_threadlist_size | ( | threadList | ) |
Get the size of a thread list
threadList | The thread list in question |
typedef void(* MUPNP_THREAD_FUNC) (mUpnpThread *) |
Prototype for the threads' worker functions
typedef struct _mUpnpThread mUpnpThread |
The generic wrapper struct for mUPnP's threads.
This wrapper has been created to enable 100% code compatibility between different platforms (Linux, Win32 etc..)
typedef struct _mUpnpThread mUpnpThreadList |
bool mupnp_thread_delete | ( | mUpnpThread * | thread | ) |
Stop and destroy a thread.
thread | Thread to destroy |
void * mupnp_thread_getuserdata | ( | mUpnpThread * | thread | ) |
Get the user data pointer
thread | Thread from which to get the pointer |
bool mupnp_thread_isrunnable | ( | mUpnpThread * | thread | ) |
Check if a thread has been started
thread | Thread to check |
mUpnpThread * mupnp_thread_new | ( | void | ) |
Create a new thread
bool mupnp_thread_restart | ( | mUpnpThread * | thread | ) |
Restart a thread. Essentially calls mupnp_thread_stop() and mupnp_thread_start()
thread | Thread to restart |
mUpnpThread * mupnp_thread_self | ( | void | ) |
Get a self reference to thread.
void mupnp_thread_setaction | ( | mUpnpThread * | thread, |
MUPNP_THREAD_FUNC | actionFunc ) |
Set the thread's worker function.
thread | Thread struct |
actionFunc | Function pointer to set as the worker function |
void mupnp_thread_setuserdata | ( | mUpnpThread * | thread, |
void * | data ) |
Set the user data pointer
thread | Thread struct |
data | Pointer to user data |
bool mupnp_thread_start | ( | mUpnpThread * | thread | ) |
Start a thread (must be created first with ch_thread_new())
thread | Thread to start |
bool mupnp_thread_stop | ( | mUpnpThread * | thread | ) |
Stop a running thread.
thread | Thread to stop |
bool mupnp_thread_stop_with_cond | ( | mUpnpThread * | thread, |
mUpnpCond * | cond ) |
Stop the running thread and signal the given CGCond.
void mupnp_threadlist_delete | ( | mUpnpThreadList * | threadList | ) |
Destroy a thread list
threadList | The thread list in question |
mUpnpThreadList * mupnp_threadlist_new | ( | void | ) |
Create a new thread list
bool mupnp_threadlist_start | ( | mUpnpThreadList * | threadList | ) |
Start all threads in the thread list
threadList | The thread list in question |
bool mupnp_threadlist_stop | ( | mUpnpThreadList * | threadList | ) |
Stop all threads in the thread list
threadList | The thread list in question |