FreeBASIC
0.91.0
|
Go to the source code of this file.
Macros | |
#define | FB_TLSGETCTX(id) (FB_##id##CTX *)fb_TlsGetCtx( FB_TLSKEY_##id, sizeof( FB_##id##CTX ) ); |
Typedefs | |
typedef void(FBCALL * | FB_THREADPROC )(void *param) |
typedef struct _FBTHREAD | FBTHREAD |
typedef struct _FBMUTEX | FBMUTEX |
typedef struct _FBCOND | FBCOND |
Enumerations | |
enum | { FB_TLSKEY_ERROR, FB_TLSKEY_DIR, FB_TLSKEY_INPUT, FB_TLSKEY_PRINTUSG, FB_TLSKEY_GFX, FB_TLSKEYS } |
Functions | |
FBCALL FBTHREAD * | fb_ThreadCreate (FB_THREADPROC proc, void *param, ssize_t stack_size) |
FBCALL void | fb_ThreadWait (FBTHREAD *thread) |
FBTHREAD * | fb_ThreadCall (void *proc, int abi, ssize_t stack_size, int num_args,...) |
ThreadCall: Launches any procedure as new thread, based on libffi. More... | |
FBCALL FBMUTEX * | fb_MutexCreate (void) |
FBCALL void | fb_MutexDestroy (FBMUTEX *mutex) |
FBCALL void | fb_MutexLock (FBMUTEX *mutex) |
FBCALL void | fb_MutexUnlock (FBMUTEX *mutex) |
FBCALL FBCOND * | fb_CondCreate (void) |
FBCALL void | fb_CondDestroy (FBCOND *cond) |
FBCALL void | fb_CondSignal (FBCOND *cond) |
FBCALL void | fb_CondBroadcast (FBCOND *cond) |
FBCALL void | fb_CondWait (FBCOND *cond, FBMUTEX *mutex) |
FBCALL void * | fb_TlsGetCtx (int index, size_t len) |
FBCALL void | fb_TlsDelCtx (int index) |
FBCALL void | fb_TlsFreeCtxTb (void) |
#define FB_TLSGETCTX | ( | id) | (FB_##id##CTX *)fb_TlsGetCtx( FB_TLSKEY_##id, sizeof( FB_##id##CTX ) ); |
Definition at line 49 of file fb_thread.h.
typedef void(FBCALL * FB_THREADPROC)(void *param) |
Definition at line 1 of file fb_thread.h.
Definition at line 10 of file fb_thread.h.
typedef struct _FBMUTEX FBMUTEX |
Definition at line 7 of file fb_thread.h.
Definition at line 4 of file fb_thread.h.
anonymous enum |
Enumerator | |
---|---|
FB_TLSKEY_ERROR | |
FB_TLSKEY_DIR | |
FB_TLSKEY_INPUT | |
FB_TLSKEY_PRINTUSG | |
FB_TLSKEY_GFX | |
FB_TLSKEYS |
Definition at line 32 of file fb_thread.h.
Definition at line 18 of file thread_cond.c.
Definition at line 10 of file thread_cond.c.
Definition at line 14 of file thread_cond.c.
Definition at line 22 of file thread_cond.c.
Definition at line 14 of file thread_mutex.c.
Definition at line 18 of file thread_mutex.c.
FBTHREAD* fb_ThreadCall | ( | void * | proc, |
int | abi, | ||
ssize_t | stack_size, | ||
int | num_args, | ||
... | |||
) |
ThreadCall: Launches any procedure as new thread, based on libffi.
For example:
FB code: declare sub MySub(x as integer, y as integer) thread = threadcall MySub(2, 3) threadwait thread
Turned into this by fbc: a = 2 b = 3 thread = fb_ThreadCall(, STDCALL, 2, INT, , INT, ) fb_ThreadWait(thread)
fb_ThreadCall() packs the call and parameter data it's given into an array of pointers and then launches a thread. The new thread reconstructs the call using LibFFI and then calls the user's procedure.
Definition at line 26 of file thread_call.c.
FBCALL FBTHREAD* fb_ThreadCreate | ( | FB_THREADPROC | proc, |
void * | param, | ||
ssize_t | stack_size | ||
) |
Definition at line 10 of file thread_core.c.
FBCALL void fb_TlsDelCtx | ( | int | index) |
FBCALL void fb_TlsFreeCtxTb | ( | void | ) |
Definition at line 51 of file thread_ctx.c.
FBCALL void* fb_TlsGetCtx | ( | int | index, |
size_t | len | ||
) |