From d47927b7491e08bdcfe5c77304aa14b1fee25270 Mon Sep 17 00:00:00 2001 From: ray Date: Mon, 9 Jul 2007 20:20:47 +0000 Subject: [PATCH] Made the Invoker a RunQueue. Don't get confused! git-svn-id: https://samskivert.googlecode.com/svn/trunk@2123 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- src/java/com/samskivert/util/Invoker.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/java/com/samskivert/util/Invoker.java b/src/java/com/samskivert/util/Invoker.java index 2416cb62..2a72f198 100644 --- a/src/java/com/samskivert/util/Invoker.java +++ b/src/java/com/samskivert/util/Invoker.java @@ -27,6 +27,7 @@ import com.samskivert.Log; * invoker is desirable. */ public class Invoker extends LoopingThread + implements RunQueue { /** * The unit encapsulates a unit of executable code that will be run on @@ -122,6 +123,23 @@ public class Invoker extends LoopingThread _queue.append(unit); } + // from RunQueue + public void postRunnable (final Runnable r) + { + postUnit(new Unit() { + public boolean invoke () { + r.run(); + return false; + } + }); + } + + // from RunQueue + public boolean isDispatchThread () + { + return (this == Thread.currentThread()); + } + // documentation inherited public void iterate () {