add mutex to openid

This commit is contained in:
sla-ppy 2024-02-08 23:29:10 +01:00
parent 5f5af9b0a7
commit e852245bae
2 changed files with 2 additions and 0 deletions

View File

@ -55,6 +55,7 @@ private:
TResourceManager& mResourceManager; TResourceManager& mResourceManager;
std::thread mUDPThread; std::thread mUDPThread;
std::thread mTCPThread; std::thread mTCPThread;
std::mutex mOpenIDMutex;
std::vector<uint8_t> UDPRcvFromClient(ip::udp::endpoint& ClientEndpoint); std::vector<uint8_t> UDPRcvFromClient(ip::udp::endpoint& ClientEndpoint);
void HandleDownload(TConnection&& TCPSock); void HandleDownload(TConnection&& TCPSock);

View File

@ -630,6 +630,7 @@ void TNetwork::OnDisconnect(const std::weak_ptr<TClient>& ClientPtr) {
} }
int TNetwork::OpenID() { int TNetwork::OpenID() {
std::unique_lock OpenIDLock(mOpenIDMutex);
int ID = 0; int ID = 0;
bool found; bool found;
do { do {