摘要: public class TestSync implements Runnable{ int num = 100; public static void main(String[] args){ TestSync syn = new TestSync(); Thread t = new Thread 阅读全文
posted @ 2020-03-05 18:07 yxfyg 阅读(103) 评论(0) 推荐(0)
摘要: public class DeadLock implements Runnable{ int flag = 1; static Object o1 = new Object(); static Object o2 = new Object(); public static void main(Str 阅读全文
posted @ 2020-03-05 16:15 yxfyg 阅读(226) 评论(0) 推荐(0)
摘要: public class TestSynchronized implements Runnable{ Timer timer = new Timer(); public static void main(String[] args){ TestSynchronized syn = new TestS 阅读全文
posted @ 2020-03-05 11:22 yxfyg 阅读(397) 评论(0) 推荐(0)
摘要: public class TestJoin{ public static void main(String[] args){ Thread t = new Thread(new MyRunner()); t.start(); try{ t.join(); } catch(InterruptedExc 阅读全文
posted @ 2020-03-05 09:44 yxfyg 阅读(167) 评论(0) 推荐(0)