Remove legacy Win32 thread entry state

This commit is contained in:
notmatthewbeshay 2026-03-11 07:56:44 +11:00
parent 78fdd89f9d
commit 2256d0fadd
5 changed files with 5 additions and 16 deletions

View file

@ -664,7 +664,6 @@ bool ServerChunkCache::save(bool force, ProgressListener *progressListener)
C4JThread::Event *wakeEvent[3]; // This sets off the threads that are waiting to continue
C4JThread::Event *notificationEvent[3]; // These are signalled by the threads to let us know they are complete
C4JThread *saveThreads[3];
DWORD threadId[3];
SaveThreadData threadData[3];
ZeroMemory(&threadData[0], sizeof(SaveThreadData));
ZeroMemory(&threadData[1], sizeof(SaveThreadData));
@ -739,7 +738,7 @@ bool ServerChunkCache::save(bool force, ProgressListener *progressListener)
{
char threadName[256];
sprintf(threadName,"Save thread %d\n",j);
SetThreadName(threadId[j], threadName);
SetThreadName(0, threadName);
//saveThreads[j] = CreateThread(NULL,0,runSaveThreadProc,&threadData[j],CREATE_SUSPENDED,&threadId[j]);
saveThreads[j] = new C4JThread(runSaveThreadProc,(void *)&threadData[j],threadName);

View file

@ -345,7 +345,7 @@ void McRegionChunkStorage::staticCtor()
}
}
int McRegionChunkStorage::runSaveThreadProc(LPVOID lpParam)
int McRegionChunkStorage::runSaveThreadProc(void *lpParam)
{
Compression::CreateNewThreadStorage();

View file

@ -39,5 +39,5 @@ public:
private:
static void WaitForAllSaves();
static void WaitForSaves();
static int runSaveThreadProc(LPVOID lpParam);
static int runSaveThreadProc(void *lpParam);
};

View file

@ -33,9 +33,6 @@ void Connection::_init()
fakeLag = 0;
slowWriteDelay = 50;
saqThreadID = 0;
closeThreadID = 0;
tickCount = 0;
}
@ -380,7 +377,7 @@ void Connection::close(DisconnectPacket::eDisconnectReason reason, ...)
// return( sum ? (sum / count) : 0 );
// CreateThread(NULL, 0, runClose, this, 0, &closeThreadID);
// CreateThread(NULL, 0, runClose, this, 0, NULL);
running = false;
@ -525,7 +522,7 @@ void Connection::sendAndQuit()
close(DisconnectPacket::eDisconnect_Closed);
}
#else
CreateThread(NULL, 0, runSendAndQuit, this, 0, &saqThreadID);
CreateThread(NULL, 0, runSendAndQuit, this, 0, NULL);
#endif
}

View file

@ -19,11 +19,6 @@ class ByteArrayOutputStream;
class Connection
{
friend DWORD WINAPI runRead(LPVOID lpParam);
friend DWORD WINAPI runWrite(LPVOID lpParam);
friend DWORD WINAPI runSendAndQuit(LPVOID lpParam);
friend DWORD WINAPI runClose(LPVOID lpParam);
private:
static const int SEND_BUFFER_SIZE = 1024 * 5;
@ -68,8 +63,6 @@ private:
C4JThread::Event* m_hWakeReadThread;
C4JThread::Event* m_hWakeWriteThread;
DWORD saqThreadID, closeThreadID;
bool disconnected;
DisconnectPacket::eDisconnectReason disconnectReason;
void **disconnectReasonObjects; // 4J a pointer to an array.