你的run()方法里的else分支里没有加while(true),所以进入else分支后只会运行一次,应该改为
else{
while (true) {
synchronized (this) {
if (tickets > 0)
...
}//end synchronized
}//end while
} //end while
else{
while (true) {
synchronized (this) {
if (tickets > 0)
...
}//end synchronized
}//end while
} //end while
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货