$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Carlo Wood (carlo_at_[hidden])
Date: 2006-06-06 11:26:56
On Tue, Jun 06, 2006 at 02:53:50PM +0200, Anne-Gert Bultena wrote:
> On the other hand, Since a
> constant value is written, it doesn't need to be a problem, even in a multi threaded environment.
>
> example:
>
> 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.
-- Carlo Wood <carlo_at_[hidden]>