X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2FMessageQueue.java;h=2f444c8e3ce8d1d0fcf1f24ad5b56fae0edb534a;hb=517e8e64135ecf6dc5a8d9d8e0a32cce978a3aef;hp=6de918532ccb1d8455a445d663973f6d3efb4f90;hpb=e58686eae8a823ed64ed0ec92c2274c41d90ec93;p=org.ibex.core.git diff --git a/src/org/xwt/MessageQueue.java b/src/org/xwt/MessageQueue.java index 6de9185..2f444c8 100644 --- a/src/org/xwt/MessageQueue.java +++ b/src/org/xwt/MessageQueue.java @@ -1,4 +1,4 @@ -// Copyright 2002 Adam Megacz, see the COPYING file for licensing [GPL] +// Copyright 2003 Adam Megacz, see the COPYING file for licensing [GPL] package org.xwt; import java.util.*; @@ -87,7 +87,8 @@ public class MessageQueue extends Thread { if (Log.on) Log.log(this, "caught throwable in MessageQueue.run(); this should never happen"); if (Log.on) Log.log(this, " currentlyPerforming == " + currentlyPerforming); if (Log.on) Log.log(this, " working == " + working); - if (Log.on) Log.log(this, " lastfunc == " + lastfunc); + // FIXME - this currently calls compiledfunction.toString which gives more info than we need + // if (Log.on) Log.log(this, " lastfunc == " + lastfunc.getDescription()); if (Log.on) Log.log(this, " lastmessage == " + lastmessage); if (Log.on) Log.log(this, t); if (Log.on) Log.log(this, "resuming MessageQueue loop"); @@ -117,18 +118,18 @@ public class MessageQueue extends Thread { if ((m != null && m == MessageQueue.currentlyPerforming) || MessageQueue.working) { String what, where; if (m != null && m instanceof ThreadMessage) { - where = org.xwt.js.JS.getCurrentFunctionSourceName((ThreadMessage)m); + where = org.xwt.js.JS.Thread.fromJavaThread((ThreadMessage)m).getSourceName(); what = "background thread"; } else if (m != null) { - where = org.xwt.js.JS.getCurrentFunctionSourceName(MessageQueue.singleton); + where = org.xwt.js.JS.Thread.fromJavaThread(MessageQueue.singleton).getSourceName(); what = "event trap"; } else { - where = org.xwt.js.JS.getCurrentFunctionSourceName(MessageQueue.singleton); + where = org.xwt.js.JS.Thread.fromJavaThread(MessageQueue.singleton).getSourceName(); what = "script"; - } - if (Log.on) Log.log(this, "note: executing same " + what + - " for " + (System.currentTimeMillis() - t) / 1000 + "s" + - " at " + where); + } + long howlong = (System.currentTimeMillis() - t) / 1000; + if (howlong >= 5) + if (Log.on) Log.log(this, "note: executing same " + what + " for " + howlong + "s" + " at " + where); } else { m = MessageQueue.currentlyPerforming; t = System.currentTimeMillis();