comparison src/thread/SDL_thread.c @ 329:1d74ddc90cb2

Patrice's fixes for GNU Pthread support
author Sam Lantinga <slouken@libsdl.org>
date Mon, 01 Apr 2002 15:35:28 +0000
parents f6ffac90895c
children b9f1ce709960
comparison
equal deleted inserted replaced
328:dc21fa30faa9 329:1d74ddc90cb2
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
55 retval = 0; 61 retval = 0;
56 /* Set the thread lock creation flag so that we can reuse an 62 /* Set the thread lock creation flag so that we can reuse an
57 existing lock on the system - since this mutex never gets 63 existing lock on the system - since this mutex never gets
58 destroyed (see SDL_ThreadsQuit()), we want to reuse it. 64 destroyed (see SDL_ThreadsQuit()), we want to reuse it.
59 */ 65 */
78 mutex = thread_lock; 84 mutex = thread_lock;
79 thread_lock = NULL; 85 thread_lock = NULL;
80 if ( mutex != NULL ) { 86 if ( mutex != NULL ) {
81 SDL_DestroyMutex(mutex); 87 SDL_DestroyMutex(mutex);
82 } 88 }
89
90 #ifdef ENABLE_PTH
91 pth_kill();
92 #endif
83 } 93 }
84 94
85 /* Routines for manipulating the thread list */ 95 /* Routines for manipulating the thread list */
86 static void SDL_AddThread(SDL_Thread *thread) 96 static void SDL_AddThread(SDL_Thread *thread)
87 { 97 {