Java synchronized method

前端 未结 3 884
我在风中等你
我在风中等你 2020-12-23 16:47

Consider this code:

public synchronized void onSignalsTimeout(List specs) {
    if (specs != null && specs.size() > 0) {
                


        
3条回答
  •  悲哀的现实
    2020-12-23 17:13

    In this context, synchronized simultaneously locks this method and any other method similarly marked as synchronized in your class.

提交回复
热议问题