comparison src/thread/pth/SDL_systhread.c @ 321:af42e7c4c860

Fixes for GNU pthreads from Patrice
author Sam Lantinga <slouken@libsdl.org>
date Sat, 30 Mar 2002 18:53:23 +0000
parents f6ffac90895c
children 1d74ddc90cb2
comparison
equal deleted inserted replaced
320:66f815c147ed 321:af42e7c4c860
49 49
50 int SDL_SYS_CreateThread(SDL_Thread *thread, void *args) 50 int SDL_SYS_CreateThread(SDL_Thread *thread, void *args)
51 { 51 {
52 pth_attr_t type; 52 pth_attr_t type;
53 53
54 type = pth_attr_new();
55
54 /* Set the thread attributes */ 56 /* Set the thread attributes */
55 if ( pth_attr_init(&type) != 0 ) { 57 if ( pth_attr_init(type) != 0 ) {
56 SDL_SetError("Couldn't initialize pth attributes"); 58 SDL_SetError("Couldn't initialize pth attributes");
57 return(-1); 59 return(-1);
58 } 60 }
59 pth_attr_set(&type, PTH_ATTR_JOINABLE, TRUE); 61 pth_attr_set(type, PTH_ATTR_JOINABLE, TRUE);
60 62
61 /* Create the thread and go! */ 63 /* Create the thread and go! */
62 if ( pth_spawn( &type, RunThread, args) != 0 ) { 64 if ( pth_spawn(type, RunThread, args) != 0 ) {
63 SDL_SetError("Not enough resources to create thread"); 65 SDL_SetError("Not enough resources to create thread");
64 return(-1); 66 return(-1);
65 } 67 }
66 return(0); 68 return(0);
67 } 69 }