![]() |
Fun 0.41.5
The programming language that makes you have fun!
|
Cross-platform thread helpers and registry used by OP_THREAD_SPAWN/OP_THREAD_JOIN. More...
#include <stdint.h>#include <time.h>#include <pthread.h>#include <unistd.h>Go to the source code of this file.
Data Structures | |
| struct | FunThreadEntry |
| struct | FunTask |
Macros | |
| #define | FUN_THREAD_CALL |
| #define | FUN_MAX_THREADS 64 |
Typedefs | |
| typedef pthread_t | fun_thread_handle_t |
| typedef void * | fun_thread_ret_t |
Functions | |
| static void | fun_sleep_ms (long ms) |
| static void | fun_lock (void) |
| static void | fun_unlock (void) |
| static fun_thread_ret_t | fun_thread_main (void *param) |
| static int | fun_alloc_thread_slot (void) |
| static int | fun_thread_spawn (Value fnVal, Value argsMaybe, int hasArgs) |
| static Value | fun_thread_join (int tid) |
Variables | |
| static FunThreadEntry | g_threads [FUN_MAX_THREADS] |
| static pthread_mutex_t | g_thr_lock = PTHREAD_MUTEX_INITIALIZER |
Cross-platform thread helpers and registry used by OP_THREAD_SPAWN/OP_THREAD_JOIN.
This file provides a tiny cross-platform threading layer (Windows/UNIX) embedded into the VM translation unit. It exposes utilities used by VM opcodes to spawn a function call in a background thread and later join it to retrieve the result.
Notes:
Definition in file thread_common.c.
| #define FUN_MAX_THREADS 64 |
Definition at line 51 of file thread_common.c.
| #define FUN_THREAD_CALL |
Definition at line 40 of file thread_common.c.
| typedef pthread_t fun_thread_handle_t |
Definition at line 38 of file thread_common.c.
| typedef void* fun_thread_ret_t |
Definition at line 39 of file thread_common.c.
|
static |
Definition at line 165 of file thread_common.c.
|
static |
Definition at line 84 of file thread_common.c.
|
inlinestatic |
Definition at line 41 of file thread_common.c.
|
static |
Definition at line 280 of file thread_common.c.
|
static |
Definition at line 102 of file thread_common.c.
Definition at line 181 of file thread_common.c.
|
static |
Definition at line 87 of file thread_common.c.
|
static |
Definition at line 83 of file thread_common.c.
|
static |
Definition at line 64 of file thread_common.c.