[vtk-developers] Crashes after recent checkins

Bill Lorensen bill.lorensen at gmail.com
Mon Aug 26 13:36:56 EDT 2013


C++ makes my head spin (and hurt!).

Thanks Brad

Not for the hurting head, but for the solution...


On Mon, Aug 26, 2013 at 1:29 PM, Brad King <brad.king at kitware.com> wrote:

> On 08/26/2013 12:05 PM, Berk Geveci wrote:
> > Can you try this?
>
> From the patch:
>
> +  if (!vtkTimeStamp::GlobalTimeStamp)
> +    {
> +#if VTK_SIZEOF_VOID_P == 8
> +    vtkTimeStamp::GlobalTimeStamp = new vtkAtomicInt64;
>
> This runtime initialization is not thread-safe, which IIUC
> is the entire point of using an atomic integer.  We can
> achieve proper static initialization and finalization using
> the same Schwarz Counter idiom:
>
>  http://en.wikibooks.org/wiki/More_C++_Idioms/Nifty_Counter
>
> that we already use in several places.  It provides a way
> to order things across translation units.
>
> -Brad
>



-- 
Unpaid intern in BillsBasement at noware dot com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20130826/d97a7019/attachment.html>


More information about the vtk-developers mailing list