mirror of
https://github.com/janet-lang/janet
synced 2024-11-25 01:37:19 +00:00
Move some defines.
This commit is contained in:
parent
55b8563c08
commit
a125218d03
@ -72,6 +72,28 @@ typedef struct {
|
||||
int32_t limit;
|
||||
} 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
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/* New fibers to spawn or resume */
|
||||
typedef struct JanetTask JanetTask;
|
||||
struct JanetTask {
|
||||
JanetFiber *fiber;
|
||||
Janet value;
|
||||
JanetSignal sig;
|
||||
};
|
||||
|
||||
/* Forward declaration */
|
||||
static void janet_unlisten(JanetListenerState *state);
|
||||
|
||||
@ -905,22 +919,6 @@ void janet_loop(void) {
|
||||
* 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
|
||||
|
||||
/* On windows, use PostQueuedCompletionStatus instead for
|
||||
|
Loading…
Reference in New Issue
Block a user