Java
ListerGray
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Semaphore信号量保证多线程执行顺序
import java.util.concurrent.Semaphore; public class ApplicationDemo10 { public static void main(String[] args) throws InterruptedException { Foo foo = new Foo(); int[] arr = new...原创 2020-05-07 22:07:33 · 1055 阅读 · 0 评论 -
synchronized 修饰方法的上锁机制
synchronized 修饰普通方法相当于 synchronized(this){ // 操作 } synchronized 修饰静态方法 synchronized(C.class){ // 操作 } 非线程安全举例 public class ApplicationDemo08 { public static void main(String[] args) throws In...原创 2020-05-06 22:15:13 · 268 阅读 · 0 评论 -
线程状态图
原创 2020-05-06 20:52:32 · 261 阅读 · 0 评论 -
线程的三种种创建方式
// 继承Thread class Thread1 extends Thread { @Override public void run() { System.out.println("继承Thread!"); } } // 实现Runnable class Thread2 implements Runnable { @Override p...原创 2020-05-06 00:05:01 · 195 阅读 · 0 评论
分享