源代码如下:
package com.mytest.Learning;
public class DeadLock {
public static void main(String [] args){
final Object resource1 = "resource1";
final Object resource2 = "resource2";
Thread t1 = new Thread(() -> {
synchronized (resource1){