Fixed places where char* was used in place of const char*
[tpg/acess2.git] / AcessNative / acesskernel_src / threads.c
diff --git a/AcessNative/acesskernel_src/threads.c b/AcessNative/acesskernel_src/threads.c
new file mode 100644 (file)
index 0000000..f7e1cb8
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Acess2 Native Kernel
+ * - Acess kernel emulation on another OS using SDL and UDP
+ *
+ * threads.c
+ * - Thread and process handling
+ */
+#include <acess.h>
+
+// === STRUCTURES ===
+typedef struct sThread
+{
+       struct sThread  *Next;
+       tTID    TID, PID;
+       tUID    UID, GID;
+
+       struct sThread  *Parent;
+
+       char    *ThreadName;
+
+       // Config?
+       Uint    Config[NUM_CFG_ENTRIES];
+}      tThread;
+
+// === GLOBALS ===
+tThread        *gpThreads;
+__thread tThread       *gpCurrentThread;
+
+// === CODE ===
+tUID Threads_GetUID() { return gpCurrentThread->UID; }
+tGID Threads_GetGID() { return gpCurrentThread->GID; }
+tTID Threads_GetTID() { return gpCurrentThread->TID; }
+tPID Threads_GetPID() { return gpCurrentThread->PID; }
+
+Uint *Threads_GetCfgPtr(int Index)
+{
+       return &gpCurrentThread->Config[Index];
+}

UCC git Repository :: git.ucc.asn.au