1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
\r
4 <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
\r
5 <meta http-equiv="Content-Style-Type" content="text/css">
\r
6 <meta name="keywords" content="Simple Directmedia Layer SDL2.0">
\r
7 <link rel="top" href="index.html" title="
\83z
\81[
\83\80">
\r
8 <link rel="parent" href="CategoryMutex.html" title="1
\82Â
\8fã">
\r
9 <title>SDL_CondWaitTimeout</title>
\r
12 <a href="index.html">
\96Ú
\8e\9f</a> - <a href="ApiByCategory.html">API(
\8b@
\94\
\95Ê)</a> - <a href="CategoryMutex.html">
\93¯
\8aú
\83v
\83\8a\83~
\83e
\83B
\83u</a> - SDL_CondWaitTimeout
\r
14 <h1>SDL_CondWaitTimeout</h1>
\r
15 \8fð
\8c\8f\95Ï
\90\94\82ª
\92Ê
\92m
\82³
\82ê
\82é
\82©
\8ew
\92è
\82Ì
\8e\9e\8aÔ
\82ª
\8co
\89ß
\82·
\82é
\82Ü
\82Å
\91Ò
\82Â
\r
17 <code>int SDL_CondWaitTimeout(SDL_cond* cond, SDL_mutex* mutex, Uint32 ms)</code>
\r
19 <table border="1" summary="SDL_CondWaitTimeout">
\r
20 <tr><td>cond</td><td>
\91Ò
\82Â
\8fð
\8c\8f\95Ï
\90\94</td></tr>
\r
21 <tr><td>mutex</td><td>
\83X
\83\8c\83b
\83h
\83A
\83N
\83Z
\83X
\82ð
\90§
\8cä
\82·
\82é
\82½
\82ß
\82Ìmutex</td></tr>
\r
22 <tr><td>ms</td><td>
\83~
\83\8a\95b
\92P
\88Ê
\82Ì
\8dÅ
\91å
\91Ò
\82¿
\8e\9e\8aÔ. SDL_MUTEX_MAXWAIT
\82Ì
\82Æ
\82«
\96³
\90§
\8cÀ
\82É
\91Ò
\82Â</td></tr>
\r
24 <h2>
\96ß
\82è
\92l</h2>
\r
25 \8fð
\8c\8f\95Ï
\90\94\82ª
\92Ê
\92m
\82³
\82ê
\82½
\82Æ
\82«0,
\92Ê
\92m
\82³
\82ê
\82¸
\82É
\91Ò
\82¿
\8e\9e\8aÔ
\82ª
\8co
\89ß
\82µ
\82½
\82Æ
\82«SDL_MUTEX_TIMEDOUT,
\8e¸
\94s
\82Ì
\82Æ
\82«
\95\89\82Ì
\90\94\82Ì
\83G
\83\89\81[
\83R
\81[
\83h
\82ð
\96ß
\82·.
\r
26 <a href="SDL_GetError.html">SDL_GetError()</a>
\82Å
\8fÚ
\8d×
\82ð
\92m
\82é
\82±
\82Æ
\82ª
\82Å
\82«
\82é.
\r
27 <h2>
\83T
\83\93\83v
\83\8b\83R
\81[
\83h</h2>
\r
31 SDL_bool condition = SDL_FALSE;
\r
35 lock = SDL_CreateMutex();
\r
36 cond = SDL_CreateCond();
\r
40 const Uint32 timeout = 1000; /* 1
\95b
\82²
\82Æ
\82É
\93®
\8dì
\82·
\82é */
\r
43 SDL_LockMutex(lock);
\r
44 while (!condition && SDL_CondWaitTimeout(cond, lock, timeout) == 0) {
\r
47 SDL_UnlockMutex(lock);
\r
53 ...
\82±
\82±
\82Å
\8eü
\8aú
\93I
\82È
\8f\88\97\9d\82ð
\8ds
\82¤
\r
57 SDL_LockMutex(lock);
\r
59 condition = SDL_TRUE;
\r
61 SDL_CondSignal(cond);
\r
62 SDL_UnlockMutex(lock);
\r
65 SDL_DestroyCond(cond);
\r
66 SDL_DestroyMutex(lock);
\r
72 \82±
\82Ì
\8aÖ
\90\94\82Ímutex
\82Ì
\83\8d\83b
\83N
\82ð
\89ð
\8f\9c\82µ,
\95Ê
\82Ì
\83X
\83\8c\83b
\83h
\82ª<a href="SDL_CondSignal.html">SDL_CondSignal()</a>
\82©<a href="SDL_CondBroadcast.html">SDL_CondBroadcast()</a>
\82ð
\8cÄ
\82ñ
\82Å
\8fð
\8c\8f\95Ï
\90\94cond
\82ð
\92Ê
\92m
\82·
\82é,
\82 \82é
\82¢
\82Í
\8ew
\92è
\82Ì
\8e\9e\8aÔ
\82ª
\8co
\89ß
\82·
\82é
\82Ü
\82Å
\91Ò
\82Â.
\r
73 \8fð
\8c\8f\95Ï
\90\94\82ª
\92Ê
\92m,
\82Ü
\82½
\82Í
\8ew
\92è
\82Ì
\8e\9e\8aÔ
\82ª
\8co
\89ß
\82·
\82ê
\82Î, mutex
\82Í
\8dÄ
\82Ñ
\83\8d\83b
\83N
\82³
\82ê
\8aÖ
\90\94\82©
\82ç
\96ß
\82é.
\r
76 mutex
\82Í
\82±
\82Ì
\8aÖ
\90\94\82ð
\8cÄ
\82Ô
\91O
\82É
\83\8d\83b
\83N
\82³
\82ê
\82Ä
\82¢
\82é
\95K
\97v
\82ª
\82 \82é.
\r
78 <h2>
\8aÖ
\98A
\8d\80\96Ú(
\8aÖ
\90\94)</h2>
\r
79 <a href="SDL_CondBroadcast.html">SDL_CondBroadcast</a><br>
\r
80 <a href="SDL_CondSignal.html">SDL_CondSignal</a><br>
\r
81 <a href="SDL_CondWait.html">SDL_CondWait</a><br>
\r
82 <a href="SDL_CreateCond.html">SDL_CreateCond</a><br>
\r
83 <a href="SDL_DestroyCond.html">SDL_DestroyCond</a><br>
\r
84 <h2>SDL Wiki
\82Ö
\82Ì
\83\8a\83\93\83N</h2>
\r
85 <a href="https://wiki.libsdl.org/SDL_CondWaitTimeout">SDL_CondWaitTimeout - SDL Wiki</a>
\r