From 3c4f1728d5cf5e2e7fda0757bc76f2dd5d092a4d Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Fri, 23 Feb 2007 19:52:50 +0000 Subject: [PATCH] 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 --- .../threerings/presents/server/PresentsDObjectMgr.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/java/com/threerings/presents/server/PresentsDObjectMgr.java b/src/java/com/threerings/presents/server/PresentsDObjectMgr.java index 4e35d9050..63c3b9751 100644 --- a/src/java/com/threerings/presents/server/PresentsDObjectMgr.java +++ b/src/java/com/threerings/presents/server/PresentsDObjectMgr.java @@ -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. Note: 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].");