X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Fthreads.c;h=4dcdb9461981a6dac8f49bfe85e4ce44a0fd8139;hb=75b702d7e74f8eb720e65adda2650bf6ce203b2c;hp=a1d3cdb920281d99775a0c87cc2fb0ae548b973f;hpb=d3c92d9489a096db306e5a028ad65ff95431ba7d;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/threads.c b/KernelLand/Kernel/threads.c index a1d3cdb9..4dcdb946 100644 --- a/KernelLand/Kernel/threads.c +++ b/KernelLand/Kernel/threads.c @@ -10,6 +10,7 @@ #include #include #include +#include #include // VFS Handle maintainence #include @@ -49,7 +50,7 @@ void Threads_Delete(tThread *Thread); char *Threads_GetName(tTID ID); #if 0 void Threads_SetPriority(tThread *Thread, int Pri); -tThread *Threads_CloneTCB(Uint *Err, Uint Flags); +tThread *Threads_CloneTCB(Uint Flags); int Threads_WaitTID(int TID, int *status); tThread *Threads_GetThread(Uint TID); #endif @@ -59,9 +60,7 @@ void Threads_int_AddToList(tThreadList *List, tThread *Thread); void Threads_Exit(int TID, int Status); void Threads_Kill(tThread *Thread, int Status); void Threads_Yield(void); -#endif int Threads_int_Sleep(enum eThreadStatus Status, void *Ptr, int Num, tThread **ListHead, tThread **ListTail, tShortSpinlock *Lock); -#if 0 void Threads_Sleep(void); int Threads_Wake(tThread *Thread); void Threads_AddActive(tThread *Thread); @@ -507,6 +506,7 @@ tTID Threads_WaitTID(int TID, int *Status) // Specific Thread if(TID > 0) { + // TODO: Register on thread to be poked when it dies tTID ret; // NOTE: Race condition - Other child dies, desired child dies, first death is 'lost' while( (ret = Threads_WaitTID(-1, Status)) != TID ) @@ -1252,6 +1252,11 @@ void Threads_int_DumpThread(tThread *thread) case THREAD_STAT_MUTEXSLEEP: Log(" Mutex Pointer: %p", thread->WaitPointer); break; + case THREAD_STAT_RWLOCKSLEEP: + Log(" Lock Pointer: %p", thread->WaitPointer); + Log(" Lock Name: %s", + ((tRWLock*)thread->WaitPointer)->Name); + break; case THREAD_STAT_SEMAPHORESLEEP: Log(" Semaphore Pointer: %p", thread->WaitPointer); Log(" Semaphore Name: %s:%s",