OSDN Git Service

SDL_Vulkan_UnloadLibrary 新規追加 https://wiki.libsdl.org/SDL_Vulkan_UnloadLibrary
[sdl2referencejp/sdl2referencejp.git] / SDL_WaitThread.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\r
2 <html lang="ja-JP">\r
3 <head>\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="CategoryThread.html" title="1\82Â\8fã">\r
9 <title>SDL_WaitThread</title>\r
10 </head>\r
11 <body>\r
12 <a href="index.html">\96Ú\8e\9f</a> - <a href="ApiByCategory.html">API(\8b@\94\\95Ê)</a> - <a href="CategoryThread.html">\83X\83\8c\83b\83h</a> - SDL_WaitThread\r
13 <hr>\r
14 <h1>SDL_WaitThread</h1>\r
15 \83X\83\8c\83b\83h\82ª\8fI\97¹\82·\82é\82Ü\82Å\91Ò\82Â\r
16 <h2>\8d\\95¶</h2>\r
17 <code>void SDL_WaitThread(SDL_Thread* thread, int* status)</code>\r
18 <h2>\88ø\90\94</h2>\r
19 <table border="1" summary="SDL_WaitThread">\r
20 <tr><td>thread</td><td><a href="SDL_CreateThread.html">SDL_CreateThread()</a>\82Å\8aJ\8en\82³\82ê\82½\83X\83\8c\83b\83h\82ÌSDL_Thread\83|\83C\83\93\83^</td></tr>\r
21 <tr><td>status</td><td>\83X\83\8c\83b\83h\8aÖ\90\94\82ªreturn\82Å\96ß\82µ\82½\92l\82ð\91ã\93ü\82·\82é\90®\90\94\82Ì\95Ï\90\94\82Ö\82Ì\83|\83C\83\93\83^</td></tr>\r
22 </table>\r
23 <h2>\83T\83\93\83v\83\8b\83R\81[\83h</h2>\r
24 <p>\r
25 <code>\r
26 <pre>\r
27 #include &lt;stdio.h&gt;\r
28 #include "SDL_thread.h"\r
29 #include "SDL_timer.h"\r
30 \r
31 // \82Æ\82Ä\82à\8aÈ\92P\82È\83X\83\8c\83b\83h - 50ms\8aÔ\8au\82Å0\82©\82ç9\82Ü\82Å\83J\83E\83\93\83g\82·\82é\r
32 int TestThread(void *ptr)\r
33 {\r
34     int cnt;\r
35 \r
36     for (cnt = 0; cnt &lt; 10; ++cnt) {\r
37         printf("\n\83X\83\8c\83b\83h\83J\83E\83\93\83^: %d", cnt);\r
38         SDL_Delay(50);\r
39     }\r
40 \r
41     return cnt;\r
42 }\r
43 \r
44 int main(int argc, char *argv[])\r
45 {\r
46     SDL_Thread   *thread;\r
47     SDL_threadID threadID;\r
48     int          threadReturnValue;\r
49 \r
50     printf("\n\8aÈ\92P\82ÈSDL_CreateThread\82Ì\83e\83X\83g:");\r
51 \r
52     // \92P\82É\83X\83\8c\83b\83h\82ð\90\90¬\82·\82é\r
53     thread = SDL_CreateThread(TestThread, "TestThread", (void *)NULL);\r
54 \r
55     if (NULL == thread) {\r
56         printf("\nSDL_CreateThread \8e¸\94s: %s\n", SDL_GetError());\r
57         exit(-1);\r
58     }\r
59 \r
60     // \90V\82µ\82­\8aJ\8en\82³\82ê\82½\83X\83\8c\83b\83h\82ÌID\82ð\93¾\82é\r
61     threadID = SDL_GetThreadID(thread);\r
62 \r
63     // \83X\83\8c\83b\83h\82Ì\8a®\97¹\82ð\91Ò\82¿\96ß\82è\92l\82ð\93¾\82é\r
64     SDL_WaitThread(thread, &amp;threadReturnValue);\r
65     printf("\n\83X\83\8c\83b\83h\82Ì\96ß\82è\92l: %d", threadReturnValue);\r
66 \r
67     return 0;\r
68 }\r
69 </pre>\r
70 </code>\r
71 </p>\r
72 <h2>\8fÚ\8d×</h2>\r
73 <p>\r
74 \83X\83\8c\83b\83h\82Ì\8fI\97¹\82ð\91Ò\82Â.\r
75 \83f\83^\83b\83`\82³\82ê\82Ä\82¢\82È\82¢\83X\83\8c\83b\83h\82Í, \82±\82Ì\8aÖ\90\94\82Å\8fÁ\96Å\82·\82é\82Ü\82Å(\81u\83]\83\93\83r\81v\82Ì\82æ\82¤\82É)\8ec\82é.\r
76 \82±\82ê\82ð\8ds\82í\82È\82¢\82Æ\83\8a\83\\81[\83X\83\8a\81[\83N\82ð\88ø\82«\8bN\82±\82·.\r
77 </p>\r
78 <p>\r
79 \82±\82Ì\8aÖ\90\94\82Å\83X\83\8c\83b\83h\82ª\8fÁ\96Å\82·\82é\82Æ, \82»\82ÌSDL_Thread\82Í\8eg\82¦\82È\82­\82È\82é\82Ì\82Å\8dÄ\82Ñ\8eQ\8fÆ\82µ\82Ä\82Í\82È\82ç\82È\82¢.\r
80 1\82Â\82Ì\83X\83\8c\83b\83h\82Ì\8fI\97¹\82ð<a href="SDL_WaitThread.html">SDL_WaitThread()</a>\82Å\91Ò\82Â\82Ì\82Í, \95Ê\82Ì1\82Â\82Ì\83X\83\8c\83b\83h\82Ì\82Ý\82É\82µ\82½\82Ù\82¤\82ª\82æ\82¢.\r
81 </p>\r
82 <p>\r
83 \83X\83\8c\83b\83h\8aÖ\90\94\82Ì\96ß\82è\92l\82Í, status\82ªNULL\82Å\82È\82¯\82ê\82Î, status\82Ì\97Ì\88æ\82É\8f\91\82«\8d\9e\82Ü\82ê\82é.\r
84 </p>\r
85 <p>\r
86 \83f\83^\83b\83`\82³\82ê\82½\83X\83\8c\83b\83h\82É\91Î\82µ\82Ä<a href="SDL_WaitThread.html">SDL_WaitThread()</a>\82ð\8cÄ\82ñ\82Å\82Í\82È\82ç\82È\82¢.\r
87 <a href="SDL_WaitThread.html">SDL_WaitThread()</a>\82©<a href="SDL_DetachThread.html">SDL_DetachThread()</a>\82Ì\82Ç\82¿\82ç\82©\82Å\82 \82è, \97¼\95û\82ð\8eg\82Á\82Ä\82Í\82È\82ç\82È\82¢. \82³\82à\82È\82­\82Î, \82»\82Ì\93®\8dì\82Í\96¢\92è\8b`\82Ì\82à\82Ì\82É\82È\82é.\r
88 </p>\r
89 <p>\r
90 \88ø\90\94\82ðNULL\82Æ\82µ\82Ä\82à\88À\91S\82Å\82 \82é.\r
91 \82»\82Ì\8fê\8d\87\82Í\96³\8e\8b\82³\82ê\82é.\r
92 </p>\r
93 <p>\r
94 thread\83|\83C\83\93\83^\82Í\82±\82Ì\8aÖ\90\94\82Å\89ð\95ú\82³\82ê\82é\82½\82ß, \82»\82Ì\8cã\82Í\8eg\82¦\82È\82¢\82Ì\82Å\92\8d\88Ó\82·\82é\82±\82Æ.\r
95 </p>\r
96 <h2>\8aÖ\98A\8d\80\96Ú(\8aÖ\90\94)</h2>\r
97 <a href="SDL_CreateThread.html">SDL_CreateThread</a><br>\r
98 <a href="SDL_DetachThread.html">SDL_DetachThread</a><br>\r
99 <h2>SDL Wiki\82Ö\82Ì\83\8a\83\93\83N</h2>\r
100 <a href="https://wiki.libsdl.org/SDL_WaitThread">SDL_WaitThread - SDL Wiki</a>\r
101 <hr>\r
102 </body>\r
103 </html>\r