mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-24 04:07:09 +07:00
22 lines
459 B
Java
22 lines
459 B
Java
import javax.annotation.concurrent.GuardedBy;
|
|
|
|
class Example
|
|
{
|
|
private final Distribution distribution = new Distribution();
|
|
|
|
public void add(long value)
|
|
{
|
|
synchronized (distribution) {
|
|
distribution.total += value;
|
|
<error descr="Cannot resolve symbol 'total'">total</error> += value;
|
|
}
|
|
|
|
}
|
|
|
|
protected static class Distribution
|
|
{
|
|
@GuardedBy("this")
|
|
private long total = 0;
|
|
}
|
|
}
|