Ok so I need to pick some brains.
Basically, I have a programming assignment to implement semaphores using pthread condition variables and a spin lock. Now the problem I have run into is that in order to block/signal threads my professor is looking for us to use pthread_cond_wait/timedwait and pthread_cond_broadcast/signal. But pthread_cond_wait requires the locking mutex as its second argument, and well we aren't allowed to use pthread_mutexs because we are using a spin lock. How would you fine gentle man suggest i work around it?