Java基礎(三十八)-線程相關

線程的同步與死鎖 1:同步問題的引出 class MyThread implements Runnable { private int ticket = 10 ; // 總票數爲10張 @Override public void run() { while (true) { if (this.ticket > 0) { System.out.println(Thread.c
相關文章
相關標籤/搜索