mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=10115
This commit is contained in:
parent
b6bed4b2d3
commit
b31e5e1a15
|
@ -4540,3 +4540,11 @@ Charlie 8 May 2006
|
||||||
|
|
||||||
api/
|
api/
|
||||||
x_opengl.C
|
x_opengl.C
|
||||||
|
|
||||||
|
Walt 8 May 2006
|
||||||
|
- Bug fix: DNS lookup when network was unavailable consumed all
|
||||||
|
available CPU. Fix limits times thru loop and adds a short
|
||||||
|
sleep before breaking out of it.
|
||||||
|
|
||||||
|
client/
|
||||||
|
client_state..C
|
||||||
|
|
|
@ -362,6 +362,7 @@ void CLIENT_STATE::do_io_or_sleep(double x) {
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
now = dtime();
|
now = dtime();
|
||||||
double end_time = now + x;
|
double end_time = now + x;
|
||||||
|
int loops = 0;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
curl_fds.zero();
|
curl_fds.zero();
|
||||||
|
@ -387,6 +388,15 @@ void CLIENT_STATE::do_io_or_sleep(double x) {
|
||||||
|
|
||||||
if (n==0) break;
|
if (n==0) break;
|
||||||
|
|
||||||
|
// Limit number of times thru this loop. Can get
|
||||||
|
// stuck in while loop, if network isn't available,
|
||||||
|
// DNS lookups tend to eat CPU cycles.
|
||||||
|
//
|
||||||
|
if (loops++ > 99) {
|
||||||
|
boinc_sleep(.01);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
now = dtime();
|
now = dtime();
|
||||||
if (now > end_time) break;
|
if (now > end_time) break;
|
||||||
x = end_time - now;
|
x = end_time - now;
|
||||||
|
|
Loading…
Reference in New Issue