338 |
* @return true if something was done. |
* @return true if something was done. |
339 |
*/ |
*/ |
340 |
protected boolean doIdle() { |
protected boolean doIdle() { |
341 |
|
Runnable r; |
342 |
synchronized(queue) { |
synchronized(queue) { |
343 |
Runnable r = (Runnable)queue.getAndRemoveLowest(); |
r = (Runnable)queue.getAndRemoveLowest(); |
344 |
if(r != null) { |
} |
345 |
if(dbg) pa("Updmanager idle: run "+r); |
if(r != null) { |
346 |
r.run(); |
if(dbg) pa("Updmanager idle: run "+r); |
347 |
if(dbg) pa("Updmanager idle: finished run "+r); |
r.run(); |
348 |
return true; |
if(dbg) pa("Updmanager idle: finished run "+r); |
349 |
} |
return true; |
350 |
} |
} |
351 |
return false; |
return false; |
352 |
} |
} |
393 |
|
|
394 |
System.gc(); |
System.gc(); |
395 |
// Wait for next event |
// Wait for next event |
396 |
|
if(dbg) pa("Updmanager: WAIT FOR EVENT!!!"); |
397 |
handleEvents(true); |
handleEvents(true); |
398 |
} |
} |
399 |
// Thread.yield(); // Again, try to let the evena thread have control. |
// Thread.yield(); // Again, try to let the evena thread have control. |