4月15日,TestPriority,每日20行。
来源:互联网 发布:ipad做笔记软件 编辑:程序博客网 时间:2024/05/20 06:23
class Resource implements Runnable { volatile public int i; public Resource(int _i){ i = _i; } public void run(){ while(true){ if(i > 0){ i--; System.out.println(Thread.currentThread().getName() + " " + i); } else{ System.out.println(Thread.currentThread().getName()); break; } } }}public class TestPriority { public static void main(String[] args) { Resource m = new Resource(100); Thread t1 = new Thread(m); Thread t2 = new Thread(m); t2.setPriority(Thread.MAX_PRIORITY); t1.start(); try{ Thread.sleep(5); } catch(Exception e){} t2.start(); }}
0 0
- 4月15日,TestPriority,每日20行。
- 6月15日,每日20行。
- 6月4日,每日20行。
- 4月20日,TestVector,每日20行。
- 3月15日,FlowLayoutDemo,每日20行。
- 4月4日,Decode,每日20行。
- 3月4日,simple_window,每日20行。
- 4月1日,StringEqualTest,每日20行。
- 4月2日,StringEqualTest1,每日20行。
- 4月3日,CharCode,每日20行。
- 4月5日,StringBufferPass,每日20行。
- 4月6日,StringBufferModify,每日20行。
- 4月7日,RemoveHZ,每日20行。
- 4月8日,DemogetProperties,每日20行。
- 4月9日,GetCurrentTime,每日20行。
- 4月10日,MyThread,每日20行。
- 4月11日,MyThread,每日20行。
- 4月12日,TestMyThread,每日20行。
- 129. Sum Root to Leaf Numbers
- leetcode数组之Plus One
- 贪心之商人小鑫
- cmd查看环境变量
- ScrollView裁剪bug?
- 4月15日,TestPriority,每日20行。
- vb.net 教程 3-1 窗体编程基础 2
- Zookeeper系列
- 高仿微信6.5.7(融云版)
- 初窥Socket:与自己聊次天
- python os读取最新创建的文件
- eclipse背景设置
- Duplicate files copied in APK META-INF/LICENSE
- Codeforces Round #408 (Div. 2) C. Bank Hacking(分类讨论)