public class WorkerThread extends Thread
{
private Counter myCounter;
private boolean isStop;
public WorkerThread()
{
this.myCounter = new Counter();
this.start();
}
public void run()
{
while(true)
{
synchronized(this)
{
this.isStop = true;
try
{
this.wait();
}
catch (InterruptedException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
this.myCounter.print();
}
}
public synchronized void startup()
{
this.isStop = false;
this.notify();
}
public synchronized boolean IsStop()
{
return this.isStop;
}
}
MultiThread多线程
需积分: 10 138 浏览量
2009-01-03
15:37:12
上传
评论
收藏 5KB RAR 举报
wyz08
- 粉丝: 0
- 资源: 1
最新资源
- 基于matlab实现串口发送接收数据 可配置端口,波特率等 发送可选择ASCII方式或HEX方式
- matlab基于BP神经网络手写字母识别(单一).zip代码9
- 基于matlab实现编写的串口调试工具,数据接收部分采用中断方式,保证了实时的数据显示
- 基于matlab实现39节点电力系统合闸角调控过程中的机组和负荷的灵敏度计算.rar
- HBase数据库性能调优
- 原生微信小程序源码 - -首字母排序选择
- 基于QT+C++开发的保卫萝卜塔防游戏+源码(毕业设计&课程设计&项目开发)
- newapp.apk
- 项目申报管理系统论文Java项目
- 8数码、α-β搜索的博弈树算法编写一字棋游戏、Fisher线性分类器、感知器算法、SVM 分类器、卷积神经网络 CNN 框架
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈