X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Tools%2Fnativelib%2Fthreads_int.c;fp=Tools%2Fnativelib%2Fthreads_int.c;h=87c60b1aa11aa86552fda362a6684e9766251610;hb=d2f1a4c62225533351551870cbe44d94a4ec4fab;hp=8ab9b341497989c1e08eb0d4a5f21e1ad679d4a6;hpb=f08ffb4a09855859328b73127ad5a62505564612;p=tpg%2Facess2.git diff --git a/Tools/nativelib/threads_int.c b/Tools/nativelib/threads_int.c index 8ab9b341..87c60b1a 100644 --- a/Tools/nativelib/threads_int.c +++ b/Tools/nativelib/threads_int.c @@ -8,6 +8,7 @@ * POSIX Mutex/Semaphore management * Wait state */ +#define DEBUG 1 #include #include #include @@ -109,9 +110,12 @@ void Threads_int_SemWaitAll(tThreadIntSem *Sem) if( Threads_int_ThreadingEnabled() ) { // TODO: Handle multiples + LOG("Waiting on %p", Sem); sem_wait( (void*)Sem ); - while( sem_trywait((void*)Sem) ) + LOG("Wait 1 done, cleaning up"); + while( sem_trywait((void*)Sem) == 0 ) ; + LOG("Wait over"); } else {