* GeoIP: Reduce thread priority during lookup

This commit is contained in:
zzz
2011-12-17 13:55:45 +00:00
parent 1488cd0f48
commit bf45e31c62

View File

@ -98,9 +98,17 @@ class GeoIP {
_pendingSearch.clear();
return;
}
LookupJob j = new LookupJob();
j.run();
updateOurCountry();
int pri = Thread.currentThread().getPriority();
if (pri > Thread.MIN_PRIORITY)
Thread.currentThread().setPriority(pri - 1);
try {
LookupJob j = new LookupJob();
j.run();
updateOurCountry();
} finally {
if (pri > Thread.MIN_PRIORITY)
Thread.currentThread().setPriority(pri);
}
}
private class LookupJob implements Runnable {