Refactor C4JThread: modernise API naming and replace Windows constants

Rename all PascalCase methods to camelCase, replace Windows macro constants with C++ constexpr members, convert ThreadPriority to enum class, remove unused Sleep(), fix memory ordering on inline accessors, extract platform code into helpers.
This commit is contained in:
MatthewBeshay
2026-03-31 01:01:25 +11:00
parent 156a23d744
commit e911e07a58
19 changed files with 458 additions and 641 deletions

View File

@@ -859,8 +859,8 @@ int ServerChunkCache::runSaveThreadProc(void* lpParam) {
}
// Wait for the producer thread to tell us to start
params->wakeEvent->WaitForSignal(
INFINITE); // WaitForSingleObject(params->wakeEvent,INFINITE);
params->wakeEvent->waitForSignal(
C4JThread::kInfiniteTimeout); // WaitForSingleObject(params->wakeEvent,INFINITE);
// app.DebugPrintf("Save thread has started\n");
@@ -880,14 +880,14 @@ int ServerChunkCache::runSaveThreadProc(void* lpParam) {
// Inform the producer thread that we are done with this chunk
params->notificationEvent
->Set(); // SetEvent(params->notificationEvent);
->set(); // SetEvent(params->notificationEvent);
// app.DebugPrintf("Save thread has alerted producer that it is
// complete\n");
// Wait for the producer thread to tell us to go again
params->wakeEvent->WaitForSignal(
INFINITE); // WaitForSingleObject(params->wakeEvent,INFINITE);
params->wakeEvent->waitForSignal(
C4JThread::kInfiniteTimeout); // WaitForSingleObject(params->wakeEvent,INFINITE);
PIXEndNamedEvent();
}