#include <threads.h>
#include <proc.h>
#include <timers_int.h>
+#include <posix_signals.h>
typedef struct sProcess tProcess;
struct sProcess
{
struct sProcess *Next;
+ struct sProcess *Prev;
tPGID PGID;
tPID PID;
int MaxFD;
char *CurrentWorkingDir;
char *RootDir;
+
+ void *SignalHandlers[NSIGNALS];
};
/**
struct sProcess *Process; //!< Thread Group / Process
struct sThread *Parent; //!< Parent Thread
char *ThreadName; //!< Name of thread
-
+
+ struct sThread *LastDeadChild; //!< Last child to die (will have the \a DeadChildren lock)
+ tMutex DeadChildLock; //!< Lock to prevent clobbering of \a LastDeadChild, acquired by child, released by parent
+
// --- arch/proc.c's responsibility
//! Kernel Stack Base
tVAddr KernelStack;
int CurFaultNum; //!< Current fault number, 0: none
tVAddr FaultHandler; //!< Fault Handler
+
+ int PendingSignal; //!< Pending signal ID (0 = none)
+
+
tMsg * volatile Messages; //!< Message Queue
tMsg *LastMessage; //!< Last Message (speeds up insertion)
"THREAD_STAT_ACTIVE",
"THREAD_STAT_SLEEPING",
"THREAD_STAT_MUTEXSLEEP",
+ "THREAD_STAT_RWLOCKSLEEP",
"THREAD_STAT_SEMAPHORESLEEP",
"THREAD_STAT_QUEUESLEEP",
"THREAD_STAT_EVENTSLEEP",
extern tThread *Threads_CloneTCB(Uint Flags);
extern tThread *Threads_CloneThreadZero(void);
+extern int Threads_int_Sleep(enum eThreadStatus Status, void *Ptr, int Num, tThread **ListHead, tThread **ListTail, tShortSpinlock *Lock);
+extern void Threads_int_WaitForStatusEnd(enum eThreadStatus Status);
+extern void Semaphore_ForceWake(tThread *Thread);
+
#endif