small fix for initial ping time

This commit is contained in:
Mark Vejvoda
2010-06-04 20:39:23 +00:00
parent 77049a2db6
commit f6517183bb

View File

@@ -696,9 +696,9 @@ float Socket::getThreadedPingMS(std::string host) {
float result = -1; float result = -1;
if(pingCache.find(host) == pingCache.end()) { if(pingCache.find(host) == pingCache.end()) {
MutexSafeWrapper safeMutex(&pingThreadAccessor); MutexSafeWrapper safeMutex(&pingThreadAccessor);
pingCache[host]=-1;
safeMutex.ReleaseLock(); safeMutex.ReleaseLock();
result = getAveragePingMS(host, 1); result = getAveragePingMS(host, 1);
pingCache[host]=result;
} }
else { else {
MutexSafeWrapper safeMutex(&pingThreadAccessor); MutexSafeWrapper safeMutex(&pingThreadAccessor);