Created
June 10, 2013 12:12
-
-
Save Ratstail91/5748293 to your computer and use it in GitHub Desktop.
Basic mutex template, using SDL's threading systems.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int thread(void*) { | |
SDL_mutexP(lock); //remember: p for pause | |
if (/* not ready */) { | |
SDL_CondWait(cond, lock); | |
} | |
//do something | |
SDL_mutexV(lock); | |
SDL_CondSignal(otherCond); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment