mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 09:24:00 +02:00
use a QMutex instead of QReadWriteMutex
This commit is contained in:
parent
dcd5a4aec2
commit
e662209754
2 changed files with 4 additions and 4 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue