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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user