Allow a unit to express that it's going to take a long time and should not be
complained about. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4599 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -69,6 +69,14 @@ public class PresentsDObjectMgr
|
||||
public int eventCount;
|
||||
}
|
||||
|
||||
/** Post instances of these if you know you're going to tie up the distributed object thread
|
||||
* for a long time and don't want a spurious warning. <em>Note:</em> this should only be done
|
||||
* during server initialization. Tying up the distributed object thread for long periods of
|
||||
* time during normal operation is a very bad idea. */
|
||||
public static interface LongRunnable extends Runnable
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the dobjmgr and prepares it for operation.
|
||||
*/
|
||||
@@ -331,7 +339,7 @@ public class PresentsDObjectMgr
|
||||
elapsed = elapsed * 1000000 / freq;
|
||||
|
||||
// report excessively long units
|
||||
if (elapsed > 500000) {
|
||||
if (elapsed > 500000 && !(unit instanceof LongRunnable)) {
|
||||
log.warning("Long dobj unit [u=" + StringUtil.safeToString(unit) +
|
||||
" (" + StringUtil.shortClassName(unit) + ")" +
|
||||
", time=" + (elapsed/1000) + "ms].");
|
||||
|
||||
Reference in New Issue
Block a user