Ignore:
Timestamp:
Jul 11, 2012, 12:59:22 PM (9 years ago)
Author:
Peter
Message:

First version of redesigned RNG that provides one instance per thread rather than one global instance. refs #568

File:
1 edited

Legend:

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

    r2747 r2768  
    2828
    2929#include <boost/concept_check.hpp>
     30#include <boost/thread/tss.hpp>
    3031
    3132#include <gsl/gsl_rng.h>
     
    8182  {
    8283  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);
    8390
    8491    ///
     
    164171    RNG& operator=(const RNG&);
    165172
    166     virtual ~RNG(void);
    167 
    168     static RNG* instance_;
     173    static boost::thread_specific_ptr<RNG> instance_;
    169174    gsl_rng* rng_;
    170175  };
Note: See TracChangeset for help on using the changeset viewer.