Fixes #1422, removes global JNI Env, uses per thread copies, adds thread auto detaching.

This commit is contained in:
Gabriel Jacobo 2012-07-09 18:08:06 -03:00
parent 7b6f9ccd63
commit 8723c73510
5 changed files with 106 additions and 44 deletions

View file

@ -40,6 +40,9 @@ extern int pthread_setname_np (pthread_t __target_thread, __const char *__name)
#include "SDL_thread.h"
#include "../SDL_thread_c.h"
#include "../SDL_systhread.h"
#ifdef __ANDROID__
#include "../../core/android/SDL_android.h"
#endif
/* List of signals to mask in the subthreads */
static const int sig_list[] = {
@ -51,6 +54,9 @@ static const int sig_list[] = {
static void *
RunThread(void *data)
{
#ifdef __ANDROID__
Android_JNI_SetupThread();
#endif
SDL_RunThread(data);
return NULL;
}