Ignore:
Timestamp:
Jan 20, 2017, 3:19:49 AM (6 years ago)
Author:
Peter
Message:

fixes #877

Generalize YAT_CXX_RVALUE into YAT_CXX_TRY_CXX11 and use that to
implement new macro YAT_CXX_ATOMIC. Use this macro in configure.ac and
use std::atomic<> conditoionally in RNG singleton.

File:
1 edited

Legend:

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

    r3579 r3591  
    2424*/
    2525
     26#include "yat/utility/config_public.h"
     27
    2628#include "yat/statistics/Histogram.h"
    2729#include "yat/utility/deprecate.h"
     
    3941
    4042#include <algorithm>
     43#ifdef YAT_HAVE_ATOMIC
     44#include <atomic>
     45#endif
    4146#include <string>
    4247#include <vector>
     
    193198    void rng_alloc(void) const;
    194199
     200#ifdef YAT_HAVE_ATOMIC
     201    static std::atomic<RNG*> instance_;
     202#else
    195203    static RNG* instance_;
     204#endif
    196205    // holds one gsl_rng per thread. Access through rng(void) so a
    197206    // gsl_rng is allocated if necessary.
Note: See TracChangeset for help on using the changeset viewer.