Fixes for GNU pthreads from Patrice
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40322
This commit is contained in:
parent
9ddae6eab1
commit
2341158b2a
2 changed files with 6 additions and 4 deletions
|
@ -1262,7 +1262,7 @@ CheckPTH()
|
||||||
use_pth=no
|
use_pth=no
|
||||||
else
|
else
|
||||||
PTH_CFLAGS=`$PTH_CONFIG --cflags`
|
PTH_CFLAGS=`$PTH_CONFIG --cflags`
|
||||||
PTH_LIBS=`$PTH_CONFIG --libs`
|
PTH_LIBS=`$PTH_CONFIG --libs --all`
|
||||||
SDL_CFLAGS="$SDL_CFLAGS $PTH_CFLAGS"
|
SDL_CFLAGS="$SDL_CFLAGS $PTH_CFLAGS"
|
||||||
SDL_LIBS="$SDL_LIBS $PTH_LIBS"
|
SDL_LIBS="$SDL_LIBS $PTH_LIBS"
|
||||||
use_pth=yes
|
use_pth=yes
|
||||||
|
|
|
@ -51,15 +51,17 @@ int SDL_SYS_CreateThread(SDL_Thread *thread, void *args)
|
||||||
{
|
{
|
||||||
pth_attr_t type;
|
pth_attr_t type;
|
||||||
|
|
||||||
|
type = pth_attr_new();
|
||||||
|
|
||||||
/* Set the thread attributes */
|
/* Set the thread attributes */
|
||||||
if ( pth_attr_init(&type) != 0 ) {
|
if ( pth_attr_init(type) != 0 ) {
|
||||||
SDL_SetError("Couldn't initialize pth attributes");
|
SDL_SetError("Couldn't initialize pth attributes");
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
pth_attr_set(&type, PTH_ATTR_JOINABLE, TRUE);
|
pth_attr_set(type, PTH_ATTR_JOINABLE, TRUE);
|
||||||
|
|
||||||
/* Create the thread and go! */
|
/* 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");
|
SDL_SetError("Not enough resources to create thread");
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue