![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
线程
MrStevens
这个作者很懒,什么都没留下…
展开
-
java模拟两个线程锁死
class A{ public synchronized void foo(B b) { String name = Thread.currentThread().getName(); System.out.println(name + "entered A.foo()"); try { Thread.sleep(100原创 2017-11-29 10:08:30 · 343 阅读 · 0 评论 -
java 多线程 避免死锁 哲学家就餐问题
源代码如下:public class Concurrence implements Runnable{ private chick pre; private chick last; private int index; public Concurrence(chick pre, chick last, int index) { this.pre = pr原创 2017-11-30 09:30:13 · 550 阅读 · 0 评论