Commit my random junk
[sandbox] / vm / thread.c
1 #ifndef THREAD
2 #define THREAD
3
4 #include "mpsc_queue.c"
5
6 struct Thread;
7 typedef struct Thread Thread;
8
9 void initializeThread(Thread* thread);
10 void destructThread(Thread* thread);
11
12 struct Thread
13 {
14   MPSCQueue inbox;
15 };
16
17 void initializeThread(Thread* thread)
18 {
19   initializeMPSCQueue(&(thread->inbox));
20 }
21
22 void destructThread(Thread* thread)
23 {
24   destructMPSCQueue(&(thread->inbox));
25 }
26
27 #endif