multiverse.server.util
Class SQThreadPool

java.lang.Object
  extended by multiverse.server.util.SQThreadPool
All Implemented Interfaces:
Runnable

public class SQThreadPool
extends Object
implements Runnable


Nested Class Summary
(package private) static class SQThreadPool.TestSQCallback<K,V>
           
(package private)  class SQThreadPool.ThreadStatus
           
 
Field Summary
protected  int blocking
           
protected  SQCallback callback
           
(package private) static int MAX_THREADS
           
(package private) static int MIN_RUN_TIME
           
(package private) static int MIN_THREADS
           
protected  int running
           
protected static ThreadLocal<SQThreadPool> selfPool
           
protected  SquareQueue sq
           
(package private) static int STATUS_BLOCKED
           
(package private) static int STATUS_NORMAL
           
protected  int threadId
           
protected static ThreadLocal<SQThreadPool.ThreadStatus> threadStatus
           
protected  int total
           
 
Constructor Summary
SQThreadPool(SquareQueue sq, SQCallback callback)
           
 
Method Summary
 void doneBlocking()
           
static SQThreadPool getRunningPool()
           
 SquareQueue getSquareQueue()
           
static void main(String[] args)
           
private  boolean retiring()
           
 void run()
           
 void runningThreadWillBlock()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIN_THREADS

static final int MIN_THREADS
See Also:
Constant Field Values

MAX_THREADS

static final int MAX_THREADS
See Also:
Constant Field Values

MIN_RUN_TIME

static final int MIN_RUN_TIME
See Also:
Constant Field Values

selfPool

protected static ThreadLocal<SQThreadPool> selfPool

threadStatus

protected static ThreadLocal<SQThreadPool.ThreadStatus> threadStatus

STATUS_NORMAL

static final int STATUS_NORMAL
See Also:
Constant Field Values

STATUS_BLOCKED

static final int STATUS_BLOCKED
See Also:
Constant Field Values

sq

protected SquareQueue sq

callback

protected SQCallback callback

total

protected int total

running

protected int running

blocking

protected int blocking

threadId

protected int threadId
Constructor Detail

SQThreadPool

public SQThreadPool(SquareQueue sq,
                    SQCallback callback)
Method Detail

getRunningPool

public static SQThreadPool getRunningPool()

runningThreadWillBlock

public void runningThreadWillBlock()

doneBlocking

public void doneBlocking()

retiring

private boolean retiring()

run

public void run()
Specified by:
run in interface Runnable

getSquareQueue

public SquareQueue getSquareQueue()

main

public static void main(String[] args)