port(EterLib): Mutex/Thread/FileLoaderThread/GrpVertexBufferDynamic verbatim over Win32Crt kernel-object shims

Adds CreateSemaphore/ReleaseSemaphore/WaitForSingleObject/CloseHandle/
SetThreadPriority/_beginthreadex to Win32Crt; port.file_loader_thread covers
the shims, CThread and both the un-Created (40250 live) and Created loader.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-09-30 12:56:24 +09:00
co-authored by Claude Opus 5.5
parent e0cdcee2e6
commit 042bddf195
13 changed files with 758 additions and 75 deletions
+20 -15
View File
@@ -1,29 +1,34 @@
// Platform skeleton for EterLib/Thread.h (40250 EterLib/Thread.cpp), generated by platform_stub.py.
// Every MT_PLATFORM_STUB() body is unimplemented: replace it with the platform implementation.
// 40250 EterLib/Thread.cpp, verbatim. The kernel32 calls resolve to the Win32Crt thread/semaphore/critical-section shims.
#include "EterLib/StdAfx.h"
#include "EterLib/Thread.h"
#include "../PlatformStub.h"
CThread::CThread()
CThread::CThread() : m_pArg(NULL), m_hThread(NULL), m_uThreadID(0)
{
MT_PLATFORM_STUB();
}
auto CThread::Create(void *) -> int
int CThread::Create(void * arg)
{
MT_PLATFORM_STUB();
return mt_platform_stub_return<int>();
Arg(arg);
m_hThread = (HANDLE) _beginthreadex(NULL, 0, EntryPoint, this, 0, &m_uThreadID);
if (!m_hThread)
return false;
SetThreadPriority(m_hThread, THREAD_PRIORITY_NORMAL);
return true;
}
auto CThread::EntryPoint(void *) -> UINT
UINT CThread::Run(void * arg)
{
MT_PLATFORM_STUB();
return mt_platform_stub_return<UINT>();
if (!Setup())
return 0;
return (Execute(arg));
}
auto CThread::Run(void *) -> UINT
/* Static */
UINT CALLBACK CThread::EntryPoint(void * pThis)
{
MT_PLATFORM_STUB();
return mt_platform_stub_return<UINT>();
CThread * pThread = (CThread *) pThis;
return pThread->Run(pThread->Arg());
}