git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Usermode/libc++ - Basic C++ runtime implementation
[tpg/acess2.git]
/
KernelLand
/
Kernel
/
semaphore.c
diff --git
a/KernelLand/Kernel/semaphore.c
b/KernelLand/Kernel/semaphore.c
index
0b70df5
..
d4ec731
100644
(file)
--- a/
KernelLand/Kernel/semaphore.c
+++ b/
KernelLand/Kernel/semaphore.c
@@
-5,6
+5,7
@@
* semaphore.c
* - Semaphores
*/
* semaphore.c
* - Semaphores
*/
+#define DEBUG 0
#include <acess.h>
#include <semaphore.h>
#include <threads_int.h>
#include <acess.h>
#include <semaphore.h>
#include <threads_int.h>
@@
-17,6
+18,7
@@
//
void Semaphore_Init(tSemaphore *Sem, int Value, int MaxValue, const char *Module, const char *Name)
{
//
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;
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;
}
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 );
SHORTLOCK( &Sem->Protector );
+ LOG("Protector grabbed");
// Check if there's already items avaliable
if( Sem->Value > 0 )
// Check if there's already items avaliable
if( Sem->Value > 0 )
UCC
git Repository :: git.ucc.asn.au