Add another thread in NetworkClient for handling ProfileManager requests outside of the main listener thread, to avoid deadlocking the waiting receivers

This commit is contained in:
Adam Honse committed 2026-07-07 01:35:35 -05:00
1 parent 68ae9ef9d5
commit 7846d22bd8
3 files changed
+120 -16

No files matched your search

+14 -1
View File
@@ -563,6 +563,19 @@ void NetworkServer::StopServer()
socket_count = 0;
/*-----------------------------------------------------*\
| Close the ProfileManager listen thread |
\*-----------------------------------------------------*/
if(profilemanager_thread->thread)
{
profilemanager_thread->online = false;
profilemanager_thread->start_cv.notify_all();
profilemanager_thread->thread->join();
delete profilemanager_thread->thread;
profilemanager_thread->thread = nullptr;
delete profilemanager_thread;
}
/*-----------------------------------------------------*\
| Client info has changed, call the callbacks |
\*-----------------------------------------------------*/
@@ -1066,7 +1079,7 @@ void NetworkServer::ControllerListenThread(NetworkServerControllerThread* this_t
void NetworkServer::ProfileManagerListenThread(NetworkServerControllerThread* this_thread)
{
while(this_thread->online == true)
while(this_thread->online == true)
{
std::unique_lock<std::mutex> start_lock(this_thread->start_mutex);
this_thread->start_cv.wait(start_lock);