* POSIX Mutex/Semaphore management
* Wait state
*/
+#define DEBUG 0
#include <stddef.h>
#include <stdlib.h>
#include <stdint.h>
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
{