X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;ds=sidebyside;f=Kernel%2Fthreads.c;h=b5ce1917a182959ac2c7ea605f5cead79b0b644c;hb=e42035c38b65d428672b128f9ae253f81b2ced96;hp=dc79908d10879f3c77feb7e599eb178bb6bb2a59;hpb=9d85201216cb35e1b1e051b1d7cdc38eaa5befa4;p=tpg%2Facess2.git diff --git a/Kernel/threads.c b/Kernel/threads.c index dc79908d..b5ce1917 100644 --- a/Kernel/threads.c +++ b/Kernel/threads.c @@ -725,7 +725,7 @@ int Threads_Wake(tThread *Thread) switch(Thread->Status) { case THREAD_STAT_ACTIVE: - Log("Thread_Wake: Waking awake thread (%i)", Thread->TID); + Log("Threads_Wake - Waking awake thread (%i)", Thread->TID); return -EALREADY; case THREAD_STAT_SLEEPING: @@ -742,15 +742,15 @@ int Threads_Wake(tThread *Thread) return -EOK; case THREAD_STAT_WAITING: - Warning("Thread_Wake - Waiting threads are not currently supported"); + Warning("Threads_Wake - Waiting threads are not currently supported"); return -ENOTIMPL; case THREAD_STAT_DEAD: - Warning("Thread_Wake - Attempt to wake dead thread (%i)", Thread->TID); + Warning("Threads_Wake - Attempt to wake dead thread (%i)", Thread->TID); return -ENOTIMPL; default: - Warning("Thread_Wake - Unknown process status (%i)\n", Thread->Status); + Warning("Threads_Wake - Unknown process status (%i)\n", Thread->Status); return -EINTERNAL; } } @@ -1312,6 +1312,7 @@ int Mutex_Acquire(tMutex *Mutex) /** * \brief Release a held mutex * \param Mutex Mutex to release + * \note Releasing a non-held mutex has no effect */ void Mutex_Release(tMutex *Mutex) { @@ -1359,9 +1360,11 @@ int Mutex_IsLocked(tMutex *Mutex) // void Semaphore_Init(tSemaphore *Sem, int Value, int MaxValue, const char *Module, const char *Name) { + memset(Sem, 0, sizeof(tSemaphore)); Sem->Value = Value; Sem->ModName = Module; Sem->Name = Name; + Sem->MaxValue = MaxValue; } // // Wait for items to be avaliable