原创 synchronized 關鍵字

在 JVM 中,對象在內存中的佈局分爲三塊區域:對象頭、實例數據、和對齊填充。Java對象頭 是實現 synchronized 對象鎖的基礎。 synchronized 的對象鎖,其指針指向的是一個 monitor(監視器) 對象的起始地