use a QMutex instead of QReadWriteMutex

This commit is contained in:
Stephen Birarda 2015-08-28 09:48:55 -07:00
parent dcd5a4aec2
commit e662209754
2 changed files with 4 additions and 4 deletions

View file

@ -143,7 +143,7 @@ qint64 Socket::writeDatagram(const QByteArray& datagram, const HifiSockAddr& soc
}
Connection& Socket::findOrCreateConnection(const HifiSockAddr& sockAddr) {
QWriteLocker locker(&_connectionsMutex);
QMutexLocker locker(&_connectionsMutex);
auto it = _connectionsHash.find(sockAddr);
@ -162,7 +162,7 @@ void Socket::clearConnections() {
return;
}
QWriteLocker locker(&_connectionsMutex);
QMutexLocker locker(&_connectionsMutex);
// clear all of the current connections in the socket
qDebug() << "Clearing all remaining connections in Socket.";
@ -170,7 +170,7 @@ void Socket::clearConnections() {
}
void Socket::cleanupConnection(HifiSockAddr sockAddr) {
QWriteLocker locker(&_connectionsMutex);
QMutexLocker locker(&_connectionsMutex);
qCDebug(networking) << "Socket::cleanupConnection called for UDT connection to" << sockAddr;
_connectionsHash.erase(sockAddr);

View file

@ -94,7 +94,7 @@ private:
std::unordered_map<HifiSockAddr, SequenceNumber> _unreliableSequenceNumbers;
std::unordered_map<HifiSockAddr, std::unique_ptr<Connection>> _connectionsHash;
QReadWriteLock _connectionsMutex; // guards concurrent access to connections hashs
QMutex _connectionsMutex; // guards concurrent access to connections hashs
int _synInterval = 10; // 10ms
QTimer _synTimer;