📄 threadpoolentry.java
字号:
// Developed by Kinva Network Inc. 2000
// Source File Name: ThreadPoolEntry.java
package com.kinva.util.thread;
import java.io.PrintStream;
// Referenced classes of package com.kinva.util.thread:
// PoolThread, ThreadPool
public class ThreadPoolEntry
{
ThreadPoolEntry(ThreadPool threadpool, PoolThread poolthread)
{
pool = threadpool;
pt = poolthread;
state = 0;
}
public PoolThread getThread()
{
return pt;
}
synchronized void waitForRelease()
{
while(state != 1)
try
{
wait();
}
catch(InterruptedException interruptedexception)
{
System.err.println(interruptedexception);
}
}
public synchronized void release()
{
state = 1;
notify();
}
void idle()
{
state = 0;
pool.insertIdle(this);
}
void init()
{
pt.setPoolEntry(this);
pt.start();
}
synchronized void shutdown()
{
if(state == 1)
pt.abort();
pt.stop();
}
public String toString()
{
return pt.toString();
}
public static final int TS_IDLE = 0;
public static final int TS_BUSY = 1;
private int state;
private PoolThread pt;
private ThreadPool pool;
ThreadPoolEntry next;
ThreadPoolEntry prev;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -