shared counter in memory
5

Worker A

private copy: —

    Worker B

    private copy: —
      Press a worker's button to let it do its next step. Turn on "Use a lock" and reset to see the fix.