Boost logo

Boost Users :

From: Anne-Gert Bultena (list-aap_at_[hidden])
Date: 2006-06-06 13:01:16


>> 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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net