1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-25 09:47:17 +00:00

Move some defines.

This commit is contained in:
Calvin Rose 2021-07-20 18:24:56 -05:00
parent 55b8563c08
commit a125218d03

View File

@ -72,6 +72,28 @@ typedef struct {
int32_t limit; int32_t limit;
} JanetChannel; } JanetChannel;
typedef struct {
JanetFiber *fiber;
Janet value;
JanetSignal sig;
} JanetTask;
/* Wrap return value by pairing it with the callback used to handle it
* in the main thread */
typedef struct {
JanetEVGenericMessage msg;
JanetThreadedCallback cb;
} JanetSelfPipeEvent;
/* Structure used to initialize threads in the thread pool
* (same head structure as self pipe event)*/
typedef struct {
JanetEVGenericMessage msg;
JanetThreadedCallback cb;
JanetThreadedSubroutine subr;
JanetHandle write_pipe;
} JanetEVThreadInit;
#define JANET_MAX_Q_CAPACITY 0x7FFFFFF #define JANET_MAX_Q_CAPACITY 0x7FFFFFF
static void janet_q_init(JanetQueue *q) { static void janet_q_init(JanetQueue *q) {
@ -127,14 +149,6 @@ static int janet_q_pop(JanetQueue *q, void *out, size_t itemsize) {
return 0; return 0;
} }
/* New fibers to spawn or resume */
typedef struct JanetTask JanetTask;
struct JanetTask {
JanetFiber *fiber;
Janet value;
JanetSignal sig;
};
/* Forward declaration */ /* Forward declaration */
static void janet_unlisten(JanetListenerState *state); static void janet_unlisten(JanetListenerState *state);
@ -905,22 +919,6 @@ void janet_loop(void) {
* Self-pipe handling code. * Self-pipe handling code.
*/ */
/* Wrap return value by pairing it with the callback used to handle it
* in the main thread */
typedef struct {
JanetEVGenericMessage msg;
JanetThreadedCallback cb;
} JanetSelfPipeEvent;
/* Structure used to initialize threads in the thread pool
* (same head structure as self pipe event)*/
typedef struct {
JanetEVGenericMessage msg;
JanetThreadedCallback cb;
JanetThreadedSubroutine subr;
JanetHandle write_pipe;
} JanetEVThreadInit;
#ifdef JANET_WINDOWS #ifdef JANET_WINDOWS
/* On windows, use PostQueuedCompletionStatus instead for /* On windows, use PostQueuedCompletionStatus instead for