本帖最后由 小太阳大开心 于 2014-6-30 11:29 编辑
import java.util.concurrent.locks.*;
class Resource
{
private String name;
private int count;
private boolean flag;
private Lock lock=new ReentrantLock();
private Condition condition_pro=new lock.newCondition();
private Condition condition_con=new lock.newCondition();
public void set(String name) throws InterruptedException
上面代码,为什么我运行后,这条private Condition condition_pro=new lock.newCondition();语句还提示我导入包啊, 我上面已经导入包了,还缺什么包吗 |
|