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
相关文章
相关标签/搜索