comparison src/thread/SDL_thread.c @ 397:283d348cb624

Pth threading bug fix
author Sam Lantinga <slouken@libsdl.org>
date Mon, 10 Jun 2002 20:42:02 +0000
parents b9f1ce709960
children b8d311d90021
comparison
equal deleted inserted replaced
396:11d6eed68dba 397:283d348cb624
50 50
51 int SDL_ThreadsInit(void) 51 int SDL_ThreadsInit(void)
52 { 52 {
53 int retval; 53 int retval;
54 54
55 #ifdef ENABLE_PTH
56 if (!pth_init()) {
57 return -1;
58 }
59 #endif
60
61 retval = 0; 55 retval = 0;
62 /* Set the thread lock creation flag so that we can reuse an 56 /* Set the thread lock creation flag so that we can reuse an
63 existing lock on the system - since this mutex never gets 57 existing lock on the system - since this mutex never gets
64 destroyed (see SDL_ThreadsQuit()), we want to reuse it. 58 destroyed (see SDL_ThreadsQuit()), we want to reuse it.
65 */ 59 */
84 mutex = thread_lock; 78 mutex = thread_lock;
85 thread_lock = NULL; 79 thread_lock = NULL;
86 if ( mutex != NULL ) { 80 if ( mutex != NULL ) {
87 SDL_DestroyMutex(mutex); 81 SDL_DestroyMutex(mutex);
88 } 82 }
89
90 #ifdef ENABLE_PTH
91 pth_kill();
92 #endif
93 } 83 }
94 84
95 /* Routines for manipulating the thread list */ 85 /* Routines for manipulating the thread list */
96 static void SDL_AddThread(SDL_Thread *thread) 86 static void SDL_AddThread(SDL_Thread *thread)
97 { 87 {