| 发表于:2007-07-23 16:11:111楼 得分:0 |
t1,t2,t3,t4 while(true){ synchronized(yourobject){ while yourobject.flag == false yourobject.wait } yourobject.number = ? yourobject.flag = false; yourobject.notifyall() } } t5: while(true){ synchronized(yourobject){ while yourobject.flag == true yourobject.wait } ? = yourobject.number create and start new thread.... yourobject.flag = ture; yourobject.notifyall() } } please try it to your best ability!! | | |
|