foo()
is so short that each thread probably finishes before the next one even gets spawned. If you add a sleep for a random time in foo()
before the u++
, you may start seeing what you expect.
foo()
is so short that each thread probably finishes before the next one even gets spawned. If you add a sleep for a random time in foo()
before the u++
, you may start seeing what you expect.