X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Tools%2Fnativelib%2Fthreads_int.c;h=ca67ba42b8e294cf520a93bf946e2f644d98914f;hb=e67143f45c221a11825e573c77ca0de0163fe7be;hp=8ab9b341497989c1e08eb0d4a5f21e1ad679d4a6;hpb=50a98c40481c6d1df267f4631228e9a4d107fe74;p=tpg%2Facess2.git diff --git a/Tools/nativelib/threads_int.c b/Tools/nativelib/threads_int.c index 8ab9b341..ca67ba42 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 0 #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 {