摘要: //加synchronize进行同步 //释放资源又很快获得自身的资源,这样不妥,吃完的话休息100ms //每个人先申请编号小的筷子 public class Philosopher implements Runnable { int[] fork=new int[5]; Thread thread1=new Thread(this,"1"); Thread thr... 阅读全文
posted @ 2017-12-31 21:02 congmingyige 阅读(551) 评论(0) 推荐(0) 编辑