[SDL] semaphore problem

Johnny Blade sadfate at yahoo.com
Thu Aug 2 16:55:01 PDT 2001


I'm testing out multithreading with SDL on Win98 using
both mingw and cygwin.  I spin off one thread that
starts its loop off by waiting on my one semaphore. 
The thread is basically the PlaySound function from
the audio example, surrounded by a while(1).  Then, on
any key press event, the semaphore is signalled, and
the thread plays the sound and then waits on the
semaphore again.

The above is all fine and dandy if I press a key once,
or twice (slow and quickly).  But if I press a key
quickly 3 times in a row, or just mash a bunch of
keys, the sound plays once and then never plays again.
 The semaphore keeps incrementing (I used SemValue to
see that).  Any idea what's wrong? is this possibly a
bug?

-JB

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/




More information about the SDL mailing list