int down_trylock(struct semaphore * sem) { Semaphore* s = (Semaphore*)sem; //Linux success == 0 return !s->tryP(); }