多線程售票

class Ticket implements Runnable{ private int tickets=10; Object lock=new Object(); public void run(){ while(true){ synchronized(lock){ try{ Thread.sleep(10); } catch(InterruptedException e){ e.printS
相關文章
相關標籤/搜索