}
*/
class ObjectLock
{
Object locka = new Object();
Object lockb = new Object();
}
public class DeadLock {
public static void main(String[] args)
{
ObjectLock ol = new ObjectLock();
Thread t1 = new Thread(new Test2(true, ol));
Thread t2 = new Thread(new Test2(false, ol));
t1.start();
t2.start();
}
}
这是我根据视频中的题改的????可以实现死锁问题了