mirror of
https://github.com/github/codeql.git
synced 2026-03-30 12:18:18 +02:00
17 lines
338 B
Java
17 lines
338 B
Java
class MultiThreadCounter {
|
|
public int counter = 0;
|
|
|
|
public void modifyCounter() {
|
|
synchronized(this) {
|
|
counter--;
|
|
}
|
|
synchronized(this) {
|
|
counter--;
|
|
}
|
|
synchronized(this) {
|
|
counter--;
|
|
}
|
|
counter = counter + 3; // No synchronization
|
|
}
|
|
}
|