摘要: /** * 线程通信 * * @Author: ITYW * @Create 2020 - 07 - 29 - 9:43 */public class Thread_wait_notify_notifyAll { public static void main(String[] args) { Nu 阅读全文
posted @ 2020-10-26 19:54 ITYW 阅读(96) 评论(0) 推荐(0) 编辑
摘要: /** * 线程安全 Lock方式 * * @Author: ITYW * @Create 2020 - 10 - 26 - 19:16 */public class RunnableSecurity_Lock { public static void main(String[] args) { R 阅读全文
posted @ 2020-10-26 19:48 ITYW 阅读(167) 评论(0) 推荐(0) 编辑
摘要: /** * Runnable方式线程安全 同步方法 * * @Author: ITYW * @Create 2020 - 10 - 26 - 18:59 */public class RunnableSecurity02 { public static void main(String[] args 阅读全文
posted @ 2020-10-26 19:42 ITYW 阅读(117) 评论(0) 推荐(0) 编辑
摘要: /** * Runnable方式线程安全 同步代码块 * * @Author: ITYW * @Create 2020 - 10 - 26 - 18:47 */public class RunnableSecurity { public static void main(String[] args) 阅读全文
posted @ 2020-10-26 19:41 ITYW 阅读(73) 评论(0) 推荐(0) 编辑
摘要: /** * 基于Thread类的线程安全问题1 同步代码块方式 * * @Author: ITYW * @Create 2020 - 10 - 26 - 18:35 */public class ThreadSecurity02 { public static void main(String[] 阅读全文
posted @ 2020-10-26 19:38 ITYW 阅读(95) 评论(0) 推荐(0) 编辑
摘要: 1.继承Thread类的方式 同步方法(以卖票为例) /** * 基于Thread类的线程安全问题1 同步方法 * * @Author: ITYW * @Create 2020 - 10 - 26 - 18:16 */public class ThreadSecurity { public stat 阅读全文
posted @ 2020-10-26 19:36 ITYW 阅读(136) 评论(0) 推荐(0) 编辑