DSL
Classes | Macros | Functions
Threads

Classes

struct  DSL_THREAD_INFO
 

Macros

#define THREADIDTYPE   pthread_t
 
#define DSL_DEFINE_THREAD(x)   THREADTYPE x(void * lpData)
 
#define DSL_THREAD_START   DSL_THREAD_INFO * tt = (DSL_THREAD_INFO *)lpData;
 
#define DSL_THREAD_END   tt->RemoveMe(tt); return NULL;
 
#define DSL_THREADEND   return NULL;
 
#define GetCurrentThreadId   pthread_self
 
#define safe_sleep_ms(sleepfor)   safe_sleep(sleepfor, true)
 
#define safe_sleep_s(sleepfor)   safe_sleep(sleepfor, false)
 

Functions

DSL_API DSL_THREAD_INFO *DSL_CC DSL_StartThread (ThreadProto Thread, void *Parm, const char *Desc=NULL, int32 id=-1)
 
DSL_API bool DSL_CC DSL_StartThreadNoRecord (ThreadProto Thread, void *Parm, const char *Desc=NULL)
 
DSL_API uint32 DSL_CC DSL_NumThreads ()
 Number of active threads (does not count threads started with DSL_StartThreadNoRecord)
 
DSL_API uint32 DSL_CC DSL_NumThreadsWithID (int id)
 Number of active threads with matching id #.
 
DSL_API void DSL_CC DSL_PrintRunningThreads ()
 
DSL_API void DSL_CC DSL_PrintRunningThreadsWithID (int id)
 
DSL_API bool DSL_CC DSL_KillThread (DSL_THREAD_INFO *tt)
 
DSL_API void DSL_CC safe_sleep (int sleepfor, bool inmilli=false)
 

Detailed Description

Function Documentation

◆ DSL_StartThread()

DSL_API DSL_THREAD_INFO* DSL_CC DSL_StartThread ( ThreadProto  Thread,
void *  Parm,
const char *  Desc = NULL,
int32  id = -1 
)

Starts a thread. Declare and define your thread with DSL_DEFINE_THREAD(Name)

Definition at line 97 of file Threading.cpp.

◆ DSL_StartThreadNoRecord()

DSL_API bool DSL_CC DSL_StartThreadNoRecord ( ThreadProto  Thread,
void *  Parm,
const char *  Desc = NULL 
)

Starts a thread with no tracking structure.

Definition at line 133 of file Threading.cpp.