mirror of
https://github.com/libretro/RetroArch
synced 2025-04-16 17:43:02 +00:00
Merge pull request #6134 from meepingsnesroms/master
Fix writing to local thread pointer instead of actual thread.(3DS threads)
This commit is contained in:
commit
194aa4ae7b
@ -40,9 +40,9 @@ typedef LightEvent pthread_cond_t;
|
|||||||
typedef int pthread_condattr_t;
|
typedef int pthread_condattr_t;
|
||||||
|
|
||||||
/* libctru threads return void but pthreads return void pointer */
|
/* libctru threads return void but pthreads return void pointer */
|
||||||
bool mutex_inited = false;
|
static bool mutex_inited = false;
|
||||||
LightLock safe_double_thread_launch;
|
static LightLock safe_double_thread_launch;
|
||||||
void *(*start_routine_jump)(void*);
|
static void *(*start_routine_jump)(void*);
|
||||||
|
|
||||||
static void ctr_thread_launcher(void* data)
|
static void ctr_thread_launcher(void* data)
|
||||||
{
|
{
|
||||||
@ -66,12 +66,13 @@ static INLINE int pthread_create(pthread_t *thread,
|
|||||||
s32 prio = 0;
|
s32 prio = 0;
|
||||||
svcGetThreadPriority(&prio, CUR_THREAD_HANDLE);
|
svcGetThreadPriority(&prio, CUR_THREAD_HANDLE);
|
||||||
start_routine_jump = start_routine;
|
start_routine_jump = start_routine;
|
||||||
thread = threadCreate(ctr_thread_launcher, arg, STACKSIZE, prio - 1, -1/*No affinity, use any CPU*/, false);
|
Thread new_ctr_thread = threadCreate(ctr_thread_launcher, arg, STACKSIZE, prio - 1, -1/*No affinity, use any CPU*/, false);
|
||||||
if (thread == NULL)
|
if (new_ctr_thread == NULL)
|
||||||
{
|
{
|
||||||
LightLock_Unlock(&safe_double_thread_launch);
|
LightLock_Unlock(&safe_double_thread_launch);
|
||||||
return EAGAIN;
|
return EAGAIN;
|
||||||
}
|
}
|
||||||
|
*thread = new_ctr_thread;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user