[SDL] SDL_CreateCond etc. not available for Win32?

Bob Pendleton bob at pendleton.com
Wed Jun 1 14:13:52 PDT 2005

On Wed, 2005-06-01 at 04:15 -0400, Ryan C. Gordon wrote:
> > I'm trying to use CondWait in my program (Win32). The
> > compiler complains with unresolved external functions.
> > Then I found out that SDL_syscond.c is not included in
> > the win32 directory (v1.2.7). My questions:
> > - Are those cond-functions not available for Win32?
> Huh, apparently not.

Say what? I use SDL_CondWait() in my net2 and fastevents libraries. I
know these have been compiled, and work, on Windows. Something is very
weird here if they compile and work in my libraries but not for other

A quick look at the code shows that SDL_syscond.c either uses pthreads
or uses a version of SDL_syscond.c in the generic subdirectory. That
version SDL_syscond.c implements the condition wait operations in terms
of mutexes. There is no need for an SDL_syscond.c in the win32

		Bob Pendleton

> The SDL functions _should_ be there, but apparently haven't ever been 
> filled in...this can probably be accomplished with win32's 
> CreateSemaphore() and WaitForSingleObject().
> > - If not available, what function can I use to suspend
> > a thread?
> SDL_*Mutex() is useful for 99% of synchronization issues, where you want 
> to make sure threads touch a resource one at a time in a serialized 
> fashion. Condition variables are more for blocking a bunch of threads, 
> and telling them all at the same time to restart...but in my experience, 
> most algorithms that do this are doing something very wrong.
> None of these will forcibly halt a different thread than the caller, if 
> that's what you were looking for.
> --ryan.
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl
+ Bob Pendleton: writer and programmer +
+ email: Bob at Pendleton.com             +
+ web: www.GameProgrammer.com          +
+ www.Wise2Food.com                    +
+ nutrient info on 6,000+ common foods +

More information about the SDL mailing list