Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
この声明が真実で必要とされる状況があるかどうか疑問に思っていました. 私が見たすべての例は、「this」参照でのみ同期します。これとは別に、あるオブジェクトのコードブロックを他の参照で同期する方法を教えてもらえますか?
public class SyncTest{ private Object obj = new Object(); public void func1() { synchronized(obj) { obj.something(); } }