Changeset View
Changeset View
Standalone View
Standalone View
b/tests/t-poll.c
| Context not available. | |||||
| static void | static void | ||||
| launch_thread (THREAD_RET_TYPE (*fnc)(void *), struct thread_arg *th) | launch_thread (THREAD_RET_TYPE (*fnc)(void *), struct thread_arg *th) | ||||
| { | { | ||||
| int stream_fileno; | |||||
| #ifdef _WIN32 | #ifdef _WIN32 | ||||
| stream_fileno=es_fileno (th->stream); | |||||
| th->thread = CreateThread (NULL, 0, fnc, th, 0, NULL); | th->thread = CreateThread (NULL, 0, fnc, th, 0, NULL); | ||||
| if (!th->thread) | if (!th->thread) | ||||
| die ("creating thread '%s' failed: rc=%d", th->name, (int)GetLastError ()); | die ("creating thread '%s' failed: rc=%d", th->name, (int)GetLastError ()); | ||||
| show ("thread '%s' launched (fd=%d)\n", th->name, es_fileno (th->stream)); | show ("thread '%s' launched (fd=%d)\n", th->name, stream_fileno); | ||||
| #elif USE_POSIX_THREADS | #elif USE_POSIX_THREADS | ||||
| stream_fileno=es_fileno (th->stream); | |||||
| th->stop_me = 0; | th->stop_me = 0; | ||||
| if (pthread_create (&th->thread, NULL, fnc, th)) | if (pthread_create (&th->thread, NULL, fnc, th)) | ||||
| die ("creating thread '%s' failed: %s\n", th->name, strerror (errno)); | die ("creating thread '%s' failed: %s\n", th->name, strerror (errno)); | ||||
| show ("thread '%s' launched (fd=%d)\n", th->name, es_fileno (th->stream)); | show ("thread '%s' launched (fd=%d)\n", th->name, stream_fileno); | ||||
| # else /* no thread support */ | # else /* no thread support */ | ||||
| Context not available. | |||||