changeset 321:af42e7c4c860

Fixes for GNU pthreads from Patrice
author Sam Lantinga <slouken@libsdl.org>
date Sat, 30 Mar 2002 18:53:23 +0000
parents 66f815c147ed
children fd93a09655e3
files configure.in src/thread/pth/SDL_systhread.c
diffstat 2 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/configure.in	Thu Mar 28 16:20:10 2002 +0000
+++ b/configure.in	Sat Mar 30 18:53:23 2002 +0000
@@ -1262,7 +1262,7 @@
             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
--- a/src/thread/pth/SDL_systhread.c	Thu Mar 28 16:20:10 2002 +0000
+++ b/src/thread/pth/SDL_systhread.c	Sat Mar 30 18:53:23 2002 +0000
@@ -51,15 +51,17 @@
 {
 	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);
 	}