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. --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404327
This commit is contained in:
parent
83fbb6981f
commit
3f0f9188ed
23 changed files with 53 additions and 51 deletions
|
@ -159,7 +159,7 @@ SDL_GetErrBuf(void)
|
|||
errbuf = &SDL_global_error;
|
||||
if (SDL_Threads) {
|
||||
int i;
|
||||
Uint32 this_thread;
|
||||
SDL_threadID this_thread;
|
||||
|
||||
this_thread = SDL_ThreadID();
|
||||
SDL_mutexP(thread_lock);
|
||||
|
@ -292,17 +292,17 @@ SDL_WaitThread(SDL_Thread * thread, int *status)
|
|||
}
|
||||
}
|
||||
|
||||
Uint32
|
||||
SDL_threadID
|
||||
SDL_GetThreadID(SDL_Thread * thread)
|
||||
{
|
||||
Uint32 id;
|
||||
SDL_threadID id;
|
||||
|
||||
if (thread) {
|
||||
id = thread->threadid;
|
||||
} else {
|
||||
id = SDL_ThreadID();
|
||||
}
|
||||
return (id);
|
||||
return id;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue