AHK_X11 icon indicating copy to clipboard operation
AHK_X11 copied to clipboard

Loop isn't thread-safe

Open phil294 opened this issue 3 years ago • 0 comments

e.g.

settimer, loop, 500
loop:
loop
{
  sleep 100
  echo %a_index%
  if a_index > 10
    break
}

prints

1
2
3
4
0
0
0
0
0
0
...

because the two loop invocations have shared state and counters and it's pure chaos

phil294 avatar Dec 19 '22 19:12 phil294