共享的资源是票,tickitsNum记录票的销售情况
对售票的过程进行加锁synchronized(this){},
模拟售票
原文:http://www.cnblogs.com/chengbao/p/4793760.html