class Main {
public static void main
(String[] args
) { t1.start();
}
}
class DeadlockRunnable
implements Runnable {
public void run() {
synchronized(onlyData) {
synchronized(onlyData) {
System.
out.
println("*** Successfully acquired both the locks"); }
}
}
}
Y2xhc3MgTWFpbiB7CiAgICBwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmdbXSBhcmdzKSB7CiAgICAgICAgVGhyZWFkIHQxID0gbmV3IFRocmVhZChuZXcgRGVhZGxvY2tSdW5uYWJsZSgpKTsKICAgICAgICB0MS5zdGFydCgpOwogICAgfQp9IAoKY2xhc3MgRGVhZGxvY2tSdW5uYWJsZSBpbXBsZW1lbnRzIFJ1bm5hYmxlIHsKICAgIHN0YXRpYyAgT2JqZWN0IG9ubHlEYXRhID0gbmV3IE9iamVjdCgpOwoKICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKICAgICAgICBzeW5jaHJvbml6ZWQob25seURhdGEpIHsKICAgICAgICAgICAgc3luY2hyb25pemVkKG9ubHlEYXRhKSB7CiAgICAgICAgICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oIioqKiBTdWNjZXNzZnVsbHkgYWNxdWlyZWQgYm90aCB0aGUgbG9ja3MiKTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0KfQ==