Ignore:
Timestamp:
Jul 11, 2012, 4:44:45 PM (10 years ago)
Author:
Peter
Message:

change back to RNG being a singleton, which now stores gsl_rng* in a thread_specific_ptr<gsl_rng>. refs #568

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/random/random.h

    r2768 r2770  
    66/*
    77  Copyright (C) 2005, 2006, 2007, 2008 Jari Häkkinen, Peter Johansson
    8   Copyright (C) 2009, 2010, 2011 Peter Johansson
     8  Copyright (C) 2009, 2010, 2011, 2012 Peter Johansson
    99
    1010  This file is part of the yat library, http://dev.thep.lu.se/yat
     
    8282  {
    8383  public:
    84     /**
    85        \brief destructor
    86      */
    87     // FIXME should be private(?) but have problems with
    88     // thread_specific_ptr<RNG> that want to destruct.
    89     virtual ~RNG(void);
    9084
    9185    ///
     
    171165    RNG& operator=(const RNG&);
    172166
    173     static boost::thread_specific_ptr<RNG> instance_;
    174     gsl_rng* rng_;
     167    virtual ~RNG(void);
     168    void rng_alloc(void) const;
     169
     170    static RNG* instance_;
     171    mutable boost::thread_specific_ptr<gsl_rng> rng_;
    175172  };
    176173
Note: See TracChangeset for help on using the changeset viewer.