2 * Acess2 libnative (Kernel Simulation Library)
3 * - By John Hodge (thePowersGang)
6 * - Threads handling definitions
8 #ifndef _THREADS_INT_H_
9 #define _THREADS_INT_H_
11 #define THREAD_EVENT_RWLOCK (1 << 8)
13 typedef struct sThreadIntMutex tThreadIntMutex; // actually pthreads
14 typedef struct sThreadIntSem tThreadIntSem;
18 struct sProcess *Next;
19 struct sThread *Threads;
34 struct sThread *ListNext;
36 struct sProcess *Process;
37 struct sThread *ProcNext;
42 tThreadIntMutex *Protector;
44 uint32_t PendingEvents;
45 uint32_t WaitingEvents;
46 tThreadIntSem *WaitSemaphore; // pthreads
51 void (*SpawnFcn)(void*);
55 extern struct sThread __thread *lpThreads_This;
57 extern int Threads_int_CreateThread(struct sThread *Thread);
58 extern int Threads_int_ThreadingEnabled(void);
60 extern tThreadIntMutex *Threads_int_MutexCreate(void);
61 extern void Threads_int_MutexDestroy(tThreadIntMutex *Mutex);
62 extern void Threads_int_MutexLock(tThreadIntMutex *Mutex);
63 extern void Threads_int_MutexRelease(tThreadIntMutex *Mutex);
65 extern tThreadIntSem *Threads_int_SemCreate(void);
66 extern void Threads_int_SemDestroy(tThreadIntSem *Sem);
67 extern void Threads_int_SemSignal(tThreadIntSem *Sem);
68 extern void Threads_int_SemWait(tThreadIntSem *Sem);
69 extern void Threads_int_SemWaitAll(tThreadIntSem *Sem);