[SDL] Thread event question

Sam Lantinga slouken at devolution.com
Fri Mar 9 12:10:52 PST 2001


> Basically, what I am seeing is the the main thread always runs and never 
> yields to the child thread. The child loop runs, I see this if I move the 
> cout before the (for) statement. However, PeepEvents always returns 0. Is 
> it possible that the the main thread is eating my user event?

Yes, that is most likely what's happening.  Instead of using PollEvent,
use PeepEvent with a mask of every event except SDL_USEREVENT.  Remember,
the SDL event queue is a thread-safe FIFO.

See ya!
	-Sam Lantinga, Lead Programmer, Loki Entertainment Software



More information about the SDL mailing list