From 707ab0bc0192e27f6ba52ee345c5d7365438cd32 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 30 Mar 2002 18:53:23 +0000 Subject: [PATCH] Fixes for GNU pthreads from Patrice --- configure.in | 2 +- src/thread/pth/SDL_systhread.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/configure.in b/configure.in index e2dec2539..ebd140e26 100644 --- a/configure.in +++ b/configure.in @@ -1262,7 +1262,7 @@ CheckPTH() use_pth=no else PTH_CFLAGS=`$PTH_CONFIG --cflags` - PTH_LIBS=`$PTH_CONFIG --libs` + PTH_LIBS=`$PTH_CONFIG --libs --all` SDL_CFLAGS="$SDL_CFLAGS $PTH_CFLAGS" SDL_LIBS="$SDL_LIBS $PTH_LIBS" use_pth=yes diff --git a/src/thread/pth/SDL_systhread.c b/src/thread/pth/SDL_systhread.c index f82e50ad8..cb16ce1c3 100644 --- a/src/thread/pth/SDL_systhread.c +++ b/src/thread/pth/SDL_systhread.c @@ -51,15 +51,17 @@ int SDL_SYS_CreateThread(SDL_Thread *thread, void *args) { pth_attr_t type; + type = pth_attr_new(); + /* Set the thread attributes */ - if ( pth_attr_init(&type) != 0 ) { + if ( pth_attr_init(type) != 0 ) { SDL_SetError("Couldn't initialize pth attributes"); return(-1); } - pth_attr_set(&type, PTH_ATTR_JOINABLE, TRUE); + pth_attr_set(type, PTH_ATTR_JOINABLE, TRUE); /* Create the thread and go! */ - if ( pth_spawn( &type, RunThread, args) != 0 ) { + if ( pth_spawn(type, RunThread, args) != 0 ) { SDL_SetError("Not enough resources to create thread"); return(-1); }