forked from I2P_Developers/i2p.i2p
* GeoIP: Reduce thread priority during lookup
This commit is contained in:
@ -98,9 +98,17 @@ class GeoIP {
|
||||
_pendingSearch.clear();
|
||||
return;
|
||||
}
|
||||
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 {
|
||||
|
Reference in New Issue
Block a user