[SDL] semaphores made from mutexes?

Carsten Griwodz Carsten.Griwodz at KOM.tu-darmstadt.de
Wed Apr 19 11:48:20 PDT 2000


> > If initial_value > 1, SDL_SemPost() will (potentially) be called by a
> > thread that has not originally locked the mutex.
> 
> That's okay.  In fact that is the way it is supposed to work.  The first
> block on the mutex when count == 0 should block, and then any subsequent
> post should unblock the waiting thread.
> 
> Am I misunderstanding you?

I assumed that this was intentional.

The problem is that this is not supported by POSIX and that it does not work
with pthreads on Linux. Only the locking thread is allowed to unlock the
mutex.

Tschuess,
   Carsten


> 
> 	-Sam Lantinga, Lead Programmer, Loki Entertainment Software
> 




More information about the SDL mailing list