Skip to content

Commit

Permalink
fix: win32 thread start issue
Browse files Browse the repository at this point in the history
  • Loading branch information
hoffstadt committed Oct 23, 2024
1 parent 797a363 commit 9040146
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pl_main_win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -1403,6 +1403,8 @@ plOSResult
pl_create_thread(plThreadProcedure ptProcedure, void* pData, plThread** ppThreadOut)
{
plThreadData* ptData = PL_ALLOC(sizeof(plThreadData));
ptData->ptProcedure = ptProcedure;
ptData->pData = pData;

HANDLE tHandle = CreateThread(0, 1024, thread_procedure, ptData, 0, NULL);
if(tHandle)
Expand All @@ -1412,8 +1414,6 @@ pl_create_thread(plThreadProcedure ptProcedure, void* pData, plThread** ppThread
*ppThreadOut = PL_ALLOC(sizeof(plThread));
(*ppThreadOut)->uID = uNextThreadId;
(*ppThreadOut)->ptData = ptData;
ptData->ptProcedure = ptProcedure;
ptData->pData = pData;
(*ppThreadOut)->tHandle = tHandle;
return PL_OS_RESULT_SUCCESS;
}
Expand Down

0 comments on commit 9040146

Please sign in to comment.