|
Boost : |
From: Sérgio Vale e Pace (svpace.forum_at_[hidden])
Date: 2005-03-16 08:57:21
> Perhaps. You might be interested to see why I originally wrote it though:
what you are doing are very common in multithreaded code. perhaps you
consider using this:
> virtual void create ( )
> {
> if ( !s_inst && !creating )
> {
auto_set < bool > reset (creating);
creating = true;
> s_inst = creator_inst.create ( );
> }
> }
the destructor goes basically the same way. But it´s not a really big
difference.
> -Jason
Sérgio
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk