Fix data races in DNSLookup (tsan)

This commit is contained in:
Benjamin Sergeant
2019-04-24 20:50:10 -07:00
parent 26ee46b246
commit a443bbdf80
4 changed files with 19 additions and 7 deletions

View File

@ -77,6 +77,7 @@ namespace ix
// the list of (connectionState, threads) for each connections
ConnectionThreads _connectionsThreads;
std::mutex _connectionsThreadsMutex;
// used to have the main control thread for a server
// wait for a 'terminate' notification without busy polling
@ -92,6 +93,7 @@ namespace ix
std::shared_ptr<ConnectionState> connectionState) = 0;
virtual size_t getConnectedClientsCount() = 0;
void closeTerminatedThreads();
// Returns true if all connection threads are joined
bool closeTerminatedThreads();
};
}