org.lobobrowser.util

Class SimpleThreadPool


public class SimpleThreadPool
extends java.lang.Object

A thread pool that allows cancelling all running tasks without shutting down the thread pool.

Constructor Summary

SimpleThreadPool(String name, int minShrinkToThreads, int maxThreads, int idleAliveMillis)

Method Summary

void
cancel(SimpleThreadPoolTask task)
void
cancelAll()
Cancels all waiting tasks and any currently running task.
void
schedule(SimpleThreadPoolTask task)

Constructor Details

SimpleThreadPool

public SimpleThreadPool(String name,
                        int minShrinkToThreads,
                        int maxThreads,
                        int idleAliveMillis)

Method Details

cancel

public void cancel(SimpleThreadPoolTask task)

cancelAll

public void cancelAll()
Cancels all waiting tasks and any currently running task.

schedule

public void schedule(SimpleThreadPoolTask task)