@GuardedBy 是否保护某些东西?

时间:2021-06-01 17:14:18

标签: java multithreading

@GuardedBy() 注释和 synchronized 块是否提供一些保护?

我的意思是,这两个函数会同步同步吗?

class FooBar {
  @GuardedBy("this")
  public void foo() {
    ...
  }

  public synchronized void bar() {
    ...
  }
}

0 个答案:

没有答案
相关问题