用CompletableFuture模擬死鎖

將兩把鎖作爲參數傳遞給MySupplier,get方法中用兩個synchronized加鎖,中間等待5秒 package com.test.jvm; import java.lang.management.ManagementFactory; import java.util.concurrent.CompletableFuture; import java.util.concurrent.Ex
相關文章
相關標籤/搜索