摘要: /** * 线程通信 * * @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 IT二叔 阅读(118) 评论(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 IT二叔 阅读(190) 评论(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 IT二叔 阅读(144) 评论(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 IT二叔 阅读(103) 评论(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 IT二叔 阅读(123) 评论(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 IT二叔 阅读(161) 评论(0) 推荐(0)