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();
|
_pendingSearch.clear();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LookupJob j = new LookupJob();
|
int pri = Thread.currentThread().getPriority();
|
||||||
j.run();
|
if (pri > Thread.MIN_PRIORITY)
|
||||||
updateOurCountry();
|
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 {
|
private class LookupJob implements Runnable {
|
||||||
|
Reference in New Issue
Block a user