Java tutorial
//package com.java2s; import java.util.concurrent.Executor; public class Main { /** * Construct a synchronous executor, which will run tasks directly on the calling thread when submitted. */ public static Executor makeSynchronousExecutor() { return new Executor() { public void execute(Runnable command) { command.run(); } }; } }