FreeBASIC  0.91.0
fb_thread.h
Go to the documentation of this file.
1 typedef void (FBCALL *FB_THREADPROC)( void *param );
2 
3 struct _FBTHREAD;
4 typedef struct _FBTHREAD FBTHREAD;
5 
6 struct _FBMUTEX;
7 typedef struct _FBMUTEX FBMUTEX;
8 
9 struct _FBCOND;
10 typedef struct _FBCOND FBCOND;
11 
12 FBCALL FBTHREAD *fb_ThreadCreate( FB_THREADPROC proc, void *param, ssize_t stack_size );
14 
15  FBTHREAD *fb_ThreadCall ( void *proc, int abi, ssize_t stack_size, int num_args, ... );
16 
17 FBCALL FBMUTEX *fb_MutexCreate ( void );
21 
22 FBCALL FBCOND *fb_CondCreate ( void );
27 
28 /**************************************************************************************************
29  * per-thread local storage context
30  **************************************************************************************************/
31 
32 enum {
39 };
40 
41 FBCALL void *fb_TlsGetCtx ( int index, size_t len );
42 FBCALL void fb_TlsDelCtx ( int index );
43 FBCALL void fb_TlsFreeCtxTb( void );
44 #ifdef ENABLE_MT
45  void fb_TlsInit ( void );
46  void fb_TlsExit ( void );
47 #endif
48 
49 #define FB_TLSGETCTX(id) (FB_##id##CTX *)fb_TlsGetCtx( FB_TLSKEY_##id, sizeof( FB_##id##CTX ) );