Skip to content

Instantly share code, notes, and snippets.

package empty;
import java.util.concurrent.atomic.AtomicInteger;
public class Foo {
int x = 0;
volatile int y = 0;
public static void main(String[] args) throws InterruptedException {
AtomicInteger counter = new AtomicInteger(0);