Kernel/IPStack - (minor) TODO retransmit timer
[tpg/acess2.git] / Tools / nativelib / threads.c
index 93db6c3..f804473 100644 (file)
@@ -5,7 +5,7 @@
  * threads.c
  * - Threads handling
  */
-#define DEBUG  1
+#define DEBUG  0
 #include <acess.h>
 #include <threads.h>
 #include <threads_int.h>
@@ -40,9 +40,12 @@ tGID Threads_GetGID(void) { return 0; }
 
 tTID Threads_GetTID(void) { return lpThreads_This ? lpThreads_This->TID : 0; }
 
-int *Threads_GetMaxFD(void)        { return &lpThreads_This->Process->MaxFDs;  }
-char **Threads_GetCWD(void)        { return &lpThreads_This->Process->CWD;     }
-char **Threads_GetChroot(void)     { return &lpThreads_This->Process->Chroot;  }
+static inline tProcess* getproc(tProcess *Process) {
+       return (Process ? Process : lpThreads_This->Process);
+}
+int *Threads_GetMaxFD(tProcess *Process)       { return &getproc(Process)->MaxFDs;  }
+char **Threads_GetCWD(tProcess *Process)        { return &getproc(Process)->CWD;     }
+char **Threads_GetChroot(tProcess *Process)     { return &getproc(Process)->Chroot;  }
 void **Threads_GetHandlesPtr(void) { return &lpThreads_This->Process->Handles; }
 
 void Threads_Yield(void)

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