Mercurial > sdl-ios-xcode
comparison src/thread/pth/SDL_systhread.c @ 3578:0d1b16ee0bca
Fixed bug #741
The thread ID is an unsigned long so it can hold pthread_t so people can do naughty things with it.
I'm going to be adding additional useful thread API functions, but this should prevent crashes in people's existing code on 64-bit architectures.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Wed, 16 Dec 2009 04:48:11 +0000 |
parents | 99210400e8b9 |
children |
comparison
equal
deleted
inserted
replaced
3577:72024425b437 | 3578:0d1b16ee0bca |
---|---|
86 | 86 |
87 /* Allow ourselves to be asynchronously cancelled */ | 87 /* Allow ourselves to be asynchronously cancelled */ |
88 pth_cancel_state(PTH_CANCEL_ASYNCHRONOUS, &oldstate); | 88 pth_cancel_state(PTH_CANCEL_ASYNCHRONOUS, &oldstate); |
89 } | 89 } |
90 | 90 |
91 /* WARNING: This may not work for systems with 64-bit pid_t */ | 91 SDL_threadID |
92 Uint32 | |
93 SDL_ThreadID(void) | 92 SDL_ThreadID(void) |
94 { | 93 { |
95 return ((Uint32) pth_self()); | 94 return ((SDL_threadID) pth_self()); |
96 } | 95 } |
97 | 96 |
98 void | 97 void |
99 SDL_SYS_WaitThread(SDL_Thread * thread) | 98 SDL_SYS_WaitThread(SDL_Thread * thread) |
100 { | 99 { |