Thread: SDL Condition variables.

  1. #1
    Registered User
    Join Date
    Sep 2004
    Posts
    80

    Question SDL Condition variables.

    I find condition variables kind of strange because my SDL book (Focus on SDL, by Ernest Pazera) states that condition variables doesn't hold any value at all. How do they work then? Any good ideas?

    To make my question more clear what happens when I signal a condition variable (to a waiting thread) if they can't hold a value?

  2. #2
    ---
    Join Date
    May 2004
    Posts
    1,379
    No idea what you mean. Post some code.

    Do you mean a condition statement?
    eg
    Code:
    if( i == 10)
    i is not assigned 10 is is only compared to it, resulting in true or false.

  3. #3
    Dump Truck Internet valis's Avatar
    Join Date
    Jul 2005
    Posts
    357
    you mean an SDL_cond?
    Code:
    struct SDL_cond
    {
    	SDL_mutex *lock;
    	int waiting;
    	int signals;
    	SDL_sem *wait_sem;
    	SDL_sem *wait_done;
    };
    Holds multiple values.

  4. #4
    Registered User
    Join Date
    Sep 2004
    Posts
    80
    Yes SDL_cond is exactly what I mean, but now I really do not understand why the book tells me that it doesn't hold any values since it seem to hold more than one... anyway thanks for your help I'll just ignore what that line in the book suggested. It just sounded stupid with a struct that would never hold a value.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. SDL Collision Handling
    By Neo1 in forum Game Programming
    Replies: 2
    Last Post: 04-02-2008, 02:04 PM
  2. SDL Window Closes...
    By FlyingIsFun1217 in forum Game Programming
    Replies: 11
    Last Post: 11-22-2007, 11:41 AM
  3. Craps Program with Local Variables
    By tigrfire in forum C Programming
    Replies: 12
    Last Post: 11-09-2005, 09:01 AM
  4. why automatic variables are assigned with garbage values
    By srinivasg in forum C Programming
    Replies: 1
    Last Post: 11-08-2005, 07:14 AM
  5. global variables
    By shadovv in forum C++ Programming
    Replies: 7
    Last Post: 10-24-2005, 02:21 PM