📄 pub_runmonitor.java
字号:
package telproject;
/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2006</p>
* <p>Company: </p>
* @author not attributable
* @version 1.0
*/
import java.lang.*;
import java.util.Date;
/**
* 定义的虚拟类,本系统所有线程类要继承本类来实现
*/
public class Pub_RunMonitor extends Pub_MyRunnable {
private Pub_MyRunnable[] thread;
private String sSystemVer = "";
public Pub_RunMonitor(Pub_MyRunnable[] thr) {
thread = thr;
}
public void run() {
System.out.println("\r\n--[线程管理模块]启动线程");
boolean bStop = false;
Pub_MyRunnable m;
int iNum = 0;
while (!bStop) {
resetIdle();
if (thread == null) {
continue;
}
for (int i = 0; i < thread.length; i++) {
if (thread[i] == null) {
continue;
}
m = thread[i];
if (m.getIdle() > 180 || !(m.isAlive())) {
m.stop();
m.start();
}
}
sleep(10);
iNum = 1;
}
}
protected void end() {
Pub_MyRunnable m;
for (int i = 0; i < thread.length; i++) {
if (thread[i] == null) {
continue;
}
m = thread[i];
m.stop();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -