GPAC
Open Source Multimedia Framework. For more information, check out http://gpac.wp.mines-telecom.fr
|
#include <gpac/thread.h>
#include <sched.h>
#include <pthread.h>
#include <semaphore.h>
#include <errno.h>
#include <gpac/list.h>
Data Structures | |
struct | GF_Thread |
abstracted thread object More... | |
struct | GF_Mutex |
abstracted mutex object More... | |
struct | GF_Semaphore |
abstracted semaphore object More... | |
Typedefs | |
typedef pthread_t | TH_HANDLE |
Functions | |
static void | log_add_thread (GF_Thread *t) |
static void | log_del_thread (GF_Thread *t) |
static const char * | log_th_name (u32 id) |
GF_Thread * | gf_th_new (const char *name) |
thread constructor More... | |
void * | RunThread (void *ptr) |
GF_Err | gf_th_run (GF_Thread *t, u32(*Run)(void *param), void *param) |
void | Thread_Stop (GF_Thread *t, Bool Destroy) |
void | gf_th_stop (GF_Thread *t) |
thread stoping More... | |
void | gf_th_del (GF_Thread *t) |
thread destructor More... | |
void | gf_th_set_priority (GF_Thread *t, s32 priority) |
thread priority More... | |
u32 | gf_th_status (GF_Thread *t) |
thread status query More... | |
u32 | gf_th_id () |
current thread ID More... | |
GF_Mutex * | gf_mx_new (const char *name) |
void | gf_mx_del (GF_Mutex *mx) |
void | gf_mx_v (GF_Mutex *mx) |
u32 | gf_mx_p (GF_Mutex *mx) |
s32 | gf_mx_get_num_locks (GF_Mutex *mx) |
Bool | gf_mx_try_lock (GF_Mutex *mx) |
GF_Semaphore * | gf_sema_new (u32 MaxCount, u32 InitCount) |
void | gf_sema_del (GF_Semaphore *sm) |
u32 | gf_sema_notify (GF_Semaphore *sm, u32 NbRelease) |
void | gf_sema_wait (GF_Semaphore *sm) |
Bool | gf_sema_wait_for (GF_Semaphore *sm, u32 TimeOut) |
Variables | |
static GF_List * | thread_bank = 0 |
struct __tag_mutex |
The abstracted mutex object allows you to make sure that portions of the code (typically access to variables) cannot be executed by two threads (or a thread and the main process) at the same time.
Data Fields | ||
---|---|---|
pthread_mutex_t | hMutex | |
u32 | Holder | |
u32 | HolderCount | |
char * | log_name |
struct __tag_semaphore |
The abstracted semaphore object allows you to control how portions of the code (typically access to variables) are executed by two threads (or a thread and the main process) at the same time. The best image for a semaphore is a limited set of money coins (always easy to understand hmm?). If no money is in the set, nobody can buy anything until a coin is put back in the set. When the set is full, the money is wasted (call it "the bank"...).
Data Fields | ||
---|---|---|
sem_t * | hSemaphore | |
sem_t | SemaData |
typedef pthread_t TH_HANDLE |
|
static |
|
static |
|
static |
void* RunThread | ( | void * | ptr | ) |
void Thread_Stop | ( | GF_Thread * | t, |
Bool | Destroy | ||
) |
|
static |