j
k
j a
j l
...int generate() { static int number = 10; return number++; } This is not thread-safe when two different threads call generate at the same time. number++ both reads and writes to number.
int generate() { static int number = 10; return number++; }
This is not thread-safe when two different threads call generate at the same time. number++ both reads and writes to number.
Yes, you're right, forgot that one. Sorry. agb
Back to the thread
Back to the list