mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 12:32:40 +02:00
thread: set arguments/fields before CreateThread
This commit is contained in:
parent
bee27ba607
commit
f12f279f45
@ -138,13 +138,7 @@ Result threadCreate(
|
||||
void *tls = (void*)((uintptr_t)reent + reent_sz);
|
||||
Handle handle;
|
||||
|
||||
rc = svcCreateThread(
|
||||
&handle, (ThreadFunc) &_EntryWrap, args, (void*)stack_top,
|
||||
prio, cpuid);
|
||||
|
||||
if (R_SUCCEEDED(rc))
|
||||
{
|
||||
t->handle = handle;
|
||||
t->handle = INVALID_HANDLE;
|
||||
t->owns_stack_mem = owns_stack_mem;
|
||||
t->stack_mem = stack_mem;
|
||||
t->stack_mirror = stack_mirror;
|
||||
@ -159,6 +153,14 @@ Result threadCreate(
|
||||
args->reent = reent;
|
||||
args->tls = tls;
|
||||
|
||||
rc = svcCreateThread(
|
||||
&handle, (ThreadFunc) &_EntryWrap, args, (void*)stack_top,
|
||||
prio, cpuid);
|
||||
|
||||
if (R_SUCCEEDED(rc))
|
||||
{
|
||||
t->handle = handle;
|
||||
|
||||
// Set up child thread's reent struct, inheriting standard file handles
|
||||
_REENT_INIT_PTR(args->reent);
|
||||
struct _reent* cur = getThreadVars()->reent;
|
||||
|
Loading…
Reference in New Issue
Block a user