X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Fsemaphore.c;h=d4ec73139c6831a19dd512d6643020f21a043986;hb=9eadc33399e705035c33e8434a9644d91e44ed44;hp=0b70df5e71069cb4144db1702c8e083915d32eca;hpb=d3c92d9489a096db306e5a028ad65ff95431ba7d;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/semaphore.c b/KernelLand/Kernel/semaphore.c index 0b70df5e..d4ec7313 100644 --- a/KernelLand/Kernel/semaphore.c +++ b/KernelLand/Kernel/semaphore.c @@ -5,6 +5,7 @@ * semaphore.c * - Semaphores */ +#define DEBUG 0 #include #include #include @@ -17,6 +18,7 @@ // void Semaphore_Init(tSemaphore *Sem, int Value, int MaxValue, const char *Module, const char *Name) { + LOG("Init %p to %i/%i (%s:%s)", Sem, Value, MaxValue, Module, Name); memset(Sem, 0, sizeof(tSemaphore)); Sem->Value = Value; Sem->ModName = Module; @@ -34,8 +36,11 @@ int Semaphore_Wait(tSemaphore *Sem, int MaxToTake) MaxToTake, Sem, Sem->Name); MaxToTake = 0; } + LOG("Waiting on %p for %i (%i/%i used atm) - (%s:%s)", + Sem, MaxToTake, Sem->Value, Sem->MaxValue, Sem->ModName, Sem->Name); SHORTLOCK( &Sem->Protector ); + LOG("Protector grabbed"); // Check if there's already items avaliable if( Sem->Value > 0 )