Implement java.util.concurrent.Executor.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@2670 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
ray.j.greenwell
2009-12-07 21:18:52 +00:00
parent 197c6fbbf8
commit 50862df9c3
+9 -1
View File
@@ -22,6 +22,8 @@ package com.samskivert.util;
import java.util.HashMap;
import java.util.concurrent.Executor;
import static com.samskivert.Log.log;
/**
@@ -40,7 +42,7 @@ import static com.samskivert.Log.log;
* is desirable.
*/
public class Invoker extends LoopingThread
implements RunQueue
implements Executor, RunQueue
{
/**
* The unit encapsulates a unit of executable code that will be run on the invoker thread. It
@@ -164,6 +166,12 @@ public class Invoker extends LoopingThread
return _queue.size();
}
// from Executor
public void execute (Runnable command)
{
postRunnable(command);
}
// from RunQueue
public void postRunnable (final Runnable r)
{