diff options
| author | fusion32 <marcopuzziello@gmail.com> | 2025-07-19 11:35:11 -0300 |
|---|---|---|
| committer | fusion32 <marcopuzziello@gmail.com> | 2025-07-19 11:35:11 -0300 |
| commit | d359c0af4874534efa810729d47f610a29687e93 (patch) | |
| tree | 9a89b06444819e7e5cef84aa826682b3b01bfd03 /src/crplayer.cc | |
| parent | 638244fd078fe91971e57b1d06e4499268d99c42 (diff) | |
| download | game-d359c0af4874534efa810729d47f610a29687e93.tar.gz game-d359c0af4874534efa810729d47f610a29687e93.zip | |
THREADING: upgrade from LinuxThreads to NPTL
This was a required change to make the server run on a modern
GLIBC version without resorting to shady shared libraries or
compatibility tricks. It is very straightforward but we should
always keep an eye out for possible bugs.
There was also a problem with the Z loop on field sending
functions that was causing the server to hang in an infinite
loop and should now be fixed.
With these changes it is now possible to login into the game
for a split second before the client asserting.
Diffstat (limited to 'src/crplayer.cc')
| -rw-r--r-- | src/crplayer.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/crplayer.cc b/src/crplayer.cc index dce7ad2..8ecc926 100644 --- a/src/crplayer.cc +++ b/src/crplayer.cc @@ -732,7 +732,7 @@ void TPlayer::TakeOver(TConnection *Connection){ return; } - if(PlayerData->Locked != getpid()){ + if(PlayerData->Locked != gettid()){ error("TPlayer::TakeOver: PlayerData-Slot ist nicht korrekt gesperrt (%d).\n", PlayerData->Locked); } @@ -2639,7 +2639,7 @@ void FreePlayerPoolSlot(TPlayerData *Slot){ return; } - if(Slot->Locked != 0 && Slot->Locked != getpid()){ + if(Slot->Locked != 0 && Slot->Locked != gettid()){ error("FreePlayerPoolSlot: Slot ist von einem anderen Thread gesperrt.\n"); return; } @@ -2693,7 +2693,7 @@ TPlayerData *AssignPlayerPoolSlot(uint32 CharacterID, bool DontWait){ } if(Slot->Locked == 0){ - Slot->Locked = getpid(); + Slot->Locked = gettid(); PlayerDataPoolMutex.up(); return Slot; } @@ -2753,7 +2753,7 @@ TPlayerData *AssignPlayerPoolSlot(uint32 CharacterID, bool DontWait){ memset(Slot, 0, sizeof(TPlayerData)); Slot->CharacterID = CharacterID; - Slot->Locked = getpid(); + Slot->Locked = gettid(); PlayerDataPoolMutex.up(); print(3, "Lade Daten für Spieler %u.\n", CharacterID); @@ -2792,7 +2792,7 @@ TPlayerData *AttachPlayerPoolSlot(uint32 CharacterID, bool DontWait){ } if(Slot->Locked == 0){ - Slot->Locked = getpid(); + Slot->Locked = gettid(); PlayerDataPoolMutex.up(); return Slot; } @@ -2817,7 +2817,7 @@ void AttachPlayerPoolSlot(TPlayerData *Slot, bool DontWait){ while(true){ PlayerDataPoolMutex.down(); if(Slot->Locked == 0){ - Slot->Locked = getpid(); + Slot->Locked = gettid(); PlayerDataPoolMutex.up(); return; } @@ -2882,7 +2882,7 @@ void ReleasePlayerPoolSlot(TPlayerData *Slot){ return; } - if(Slot->Locked != getpid()){ + if(Slot->Locked != gettid()){ error("ReleasePlayerPoolSlot: Slot ist von einem anderen Thread gesperrt.\n"); return; } @@ -2908,7 +2908,7 @@ void SavePlayerPoolSlots(void){ } AttachPlayerPoolSlot(Slot, true); - if(Slot->Locked == getpid()){ + if(Slot->Locked == gettid()){ SavePlayerPoolSlot(Slot); ReleasePlayerPoolSlot(Slot); } |
