git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Misc changes
[tpg/acess2.git]
/
AcessNative
/
acesskernel_src
/
threads.c
diff --git
a/AcessNative/acesskernel_src/threads.c
b/AcessNative/acesskernel_src/threads.c
index
5f29f76
..
5a0ce13
100644
(file)
--- a/
AcessNative/acesskernel_src/threads.c
+++ b/
AcessNative/acesskernel_src/threads.c
@@
-7,8
+7,9
@@
*/
#define _SIGNAL_H_
#undef CLONE_VM // Such a hack
*/
#define _SIGNAL_H_
#undef CLONE_VM // Such a hack
-#include <a
cess
.h>
+#include <a
rch
.h>
#include <unistd.h>
#include <unistd.h>
+#include <sys/types.h>
#include <stdint.h>
#include "/usr/include/signal.h"
#include <stdint.h>
#include "/usr/include/signal.h"
@@
-44,8
+45,12
@@
typedef struct sThread
} tThread;
// === GLOBALS ===
} tThread;
// === GLOBALS ===
-tThread *gpThreads;
-__thread tThread *gpCurrentThread;
+tThread gThread_Zero = {
+ State: 1,
+ ThreadName: "ThreadZero"
+};
+tThread *gpThreads = &gThread_Zero;
+__thread tThread *gpCurrentThread = &gThread_Zero;
// === CODE ===
tThread *Threads_GetThread(int TID)
// === CODE ===
tThread *Threads_GetThread(int TID)
@@
-62,10
+67,17
@@
tThread *Threads_GetThread(int TID)
tUID Threads_GetUID() { return gpCurrentThread->UID; }
tGID Threads_GetGID() { return gpCurrentThread->GID; }
tTID Threads_GetTID() { return gpCurrentThread->TID; }
tUID Threads_GetUID() { return gpCurrentThread->UID; }
tGID Threads_GetGID() { return gpCurrentThread->GID; }
tTID Threads_GetTID() { return gpCurrentThread->TID; }
-tPID Threads_GetPID() { return gpCurrentThread->PID; }
+tPID Threads_GetPID() {
+ return SDL_ThreadID();
+ //return gpCurrentThread->PID;
+}
Uint *Threads_GetCfgPtr(int Index)
{
Uint *Threads_GetCfgPtr(int Index)
{
+ if( Index < 0 || Index >= NUM_CFG_ENTRIES )
+ return NULL;
+ if( !gpCurrentThread )
+ return NULL;
return &gpCurrentThread->Config[Index];
}
return &gpCurrentThread->Config[Index];
}
UCC
git Repository :: git.ucc.asn.au