.\" This manpage content is licensed under Creative Commons .\" Attribution 4.0 International (CC BY 4.0) .\" https://creativecommons.org/licenses/by/4.0/ .\" This manpage was generated from SDL's wiki page for SDL_WaitConditionTimeout: .\" https://wiki.libsdl.org/SDL_WaitConditionTimeout .\" Generated with SDL/build-scripts/wikiheaders.pl .\" revision SDL-3.1.0 .\" Please report issues in this manpage's content at: .\" https://github.com/libsdl-org/sdlwiki/issues/new .\" Please report issues in the generation of this manpage from the wiki at: .\" https://github.com/libsdl-org/SDL/issues/new?title=Misgenerated%20manpage%20for%20SDL_WaitConditionTimeout .\" SDL can be found at https://libsdl.org/ .de URL \$2 \(laURL: \$1 \(ra\$3 .. .if \n[.g] .mso www.tmac .TH SDL_WaitConditionTimeout 3 "SDL 3.1.0" "SDL" "SDL3 FUNCTIONS" .SH NAME SDL_WaitConditionTimeout \- Wait until a condition variable is signaled or a certain time has passed\[char46] .SH SYNOPSIS .nf .B #include \(dqSDL3/SDL.h\(dq .PP .BI "int SDL_WaitConditionTimeout(SDL_Condition *cond, .BI " SDL_Mutex *mutex, Sint32 timeoutMS); .fi .SH DESCRIPTION This function unlocks the specified .BR mutex and waits for another thread to call .BR SDL_SignalCondition () or .BR SDL_BroadcastCondition () on the condition variable .BR cond , or for the specified time to elapse\[char46] Once the condition variable is signaled or the time elapsed, the mutex is re-locked and the function returns\[char46] The mutex must be locked before calling this function\[char46] Locking the mutex recursively (more than once) is not supported and leads to undefined behavior\[char46] .SH FUNCTION PARAMETERS .TP .I cond the condition variable to wait on .TP .I mutex the mutex used to coordinate thread access .TP .I timeoutMS the maximum time to wait, in milliseconds, or -1 to wait indefinitely .SH RETURN VALUE Returns 0 if the condition variable is signaled, .BR .BR SDL_MUTEX_TIMEDOUT if the condition is not signaled in the allotted time, or a negative error code on failure; call .BR SDL_GetError () for more information\[char46] .SH AVAILABILITY This function is available since SDL 3\[char46]0\[char46]0\[char46] .SH SEE ALSO .BR SDL_BroadcastCondition (3), .BR SDL_SignalCondition (3), .BR SDL_WaitCondition (3)