@GuardedBy
且不受适当同步结构保护的访问字段。
示例:
@GuardedBy("this")
void x() {
notify();
}
void y() {
x(); // 不受保护的方法调用
}
支持的 @GuardedBy
注解是:
net.jcip.annotations.GuardedBy
javax.annotation.concurrent.GuardedBy
org.apache.http.annotation.GuardedBy
com.android.annotations.concurrency.GuardedBy
androidx.annotation.GuardedBy
com.google.errorprone.annotations.concurrent.GuardedBy