→ tkcn:因為 register 是 static method,沒有 this 01/24 22:24
→ coolcomm:所以和static void synchronized register完全一樣囉? 01/24 22:29
→ tkcn:是,但你上面的例子還有個 getRegistry 在外面,所以不同 01/24 23:16
→ coolcomm:嗯 這部分了解了 01/24 23:21
※ 編輯: coolcomm 來自: 1.163.82.56 (01/24 23:24)
→ n3oanderson:This is check then act scenario, which is not 01/26 15:37
→ n3oanderson:thred safe. 01/26 15:39
囧 我發現我忘了貼getRegistry()的定義
static Set<IDKey> getRegistry() { return REGISTRY.get(); }
就這樣一行
※ 編輯: coolcomm 來自: 114.43.180.83 (01/27 09:11)
※ coolcomm:轉錄至看板 Programming 02/05 19:37