X-Git-Url: https://code.kerkeslager.com/?a=blobdiff_plain;f=vm%2Fthread.c;fp=vm%2Fthread.c;h=87a1ec696e1b3b31d360ccda988abd52c37dc47d;hb=d1c74f98db73d4c643bb2d0e0338b350a05289b0;hp=0000000000000000000000000000000000000000;hpb=919d7b64f267c21abc1f69ccf9bdb7e6824b6add;p=sandbox diff --git a/vm/thread.c b/vm/thread.c new file mode 100644 index 0000000..87a1ec6 --- /dev/null +++ b/vm/thread.c @@ -0,0 +1,27 @@ +#ifndef THREAD +#define THREAD + +#include "mpsc_queue.c" + +struct Thread; +typedef struct Thread Thread; + +void initializeThread(Thread* thread); +void destructThread(Thread* thread); + +struct Thread +{ + MPSCQueue inbox; +}; + +void initializeThread(Thread* thread) +{ + initializeMPSCQueue(&(thread->inbox)); +} + +void destructThread(Thread* thread) +{ + destructMPSCQueue(&(thread->inbox)); +} + +#endif