Merge branch 'master' into jgrpp
# Conflicts: # src/CMakeLists.txt # src/network/network_server.cpp # src/network/network_survey.cpp # src/vehiclelist.cpp
This commit is contained in:
@@ -281,10 +281,9 @@ void NetworkHTTPUninitialize()
|
||||
{
|
||||
_http_thread_exit = true;
|
||||
|
||||
/* Queues must be cleared (and the queue CV signalled) after _http_thread_exit is set to ensure that the HTTP thread can exit */
|
||||
for (auto &callback : _http_callbacks) {
|
||||
callback->ClearQueue();
|
||||
}
|
||||
/* Ensure the callbacks are handled. This is mostly needed as we send
|
||||
* a survey just before close, and that might be pending here. */
|
||||
NetworkHTTPSocketHandler::HTTPReceive();
|
||||
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(_http_mutex);
|
||||
|
@@ -96,20 +96,6 @@ public:
|
||||
return this->queue.empty();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Clear everything in the queue.
|
||||
*
|
||||
* Should be called from the Game Thread.
|
||||
*/
|
||||
void ClearQueue()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(this->mutex);
|
||||
|
||||
this->queue.clear();
|
||||
this->queue_cv.notify_all();
|
||||
}
|
||||
|
||||
HTTPThreadSafeCallback(HTTPCallback *callback) : callback(callback) {}
|
||||
|
||||
~HTTPThreadSafeCallback()
|
||||
|
Reference in New Issue
Block a user