Skip to content
ranxsh edited this page Apr 4, 2017 · 1 revision

if (number >= 10) { try { this.wait(); } catch (Exception e) { e.printStackTrace(); } System.out.println(Thread.currentThread().getName()+ ":存放等待---仓库库存足够"); return; }

这个retrun好像不合理呢 wait 被唤醒就有电脑用了 就可以生产了

if (number >= 10) { try { System.out.println(Thread.currentThread().getName()+ ":存放等待---仓库库存足够"); this.wait(); } catch (Exception e) { e.printStackTrace(); }

// return; }

Clone this wiki locally