Some work on the vm
[sandbox] / vm / thread.c
diff --git a/vm/thread.c b/vm/thread.c
new file mode 100644 (file)
index 0000000..87a1ec6
--- /dev/null
@@ -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