Make new timeout code lock-safe on Qt 4.2. Oops.

git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@488 05730e5d-ab1b-0410-a4ac-84af385074fa
This commit is contained in:
Thorvald Natvig 2007-06-22 11:03:18 +00:00
parent 77cf9320c9
commit be21e2871a

View File

@ -426,13 +426,18 @@ void Server::message(QByteArray &qbaMsg, Connection *cCon) {
void Server::checkTimeout() {
QWriteLocker wl(&qrwlConnections);
QList<Connection *> qlClose;
qrwlConnections.lockForRead();
foreach(Connection *c, qmConnections) {
if (c->activityTime() > (g_sp.iTimeout * 1000)) {
log(QLatin1String("Timeout"), c);
c->disconnect();
qlClose.append(c);
}
}
qrwlConnections.unlock();
foreach(Connection *c, qlClose)
c->disconnect();
}
void Server::emitPacket(Message *msg) {