Ignore:
Timestamp:
Jan 16, 2017, 4:54:43 AM (5 years ago)
Author:
Peter
Message:

merge release 0.14 into trunk

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/yat/random/random.cc

    r3469 r3579  
    33/*
    44  Copyright (C) 2005, 2006, 2007, 2008 Jari Häkkinen, Peter Johansson
    5   Copyright (C) 2009, 2011, 2012, 2013, 2015, 2016 Peter Johansson
     5  Copyright (C) 2009, 2011, 2012, 2013, 2015, 2016, 2017 Peter Johansson
    66
    77  This file is part of the yat library, http://dev.thep.lu.se/yat
     
    3939
    4040  RNG* RNG::instance_=NULL;
     41  boost::mutex RNG::init_mutex_;
    4142
    4243  RNG::RNG(void)
     
    5960  RNG* RNG::instance(void)
    6061  {
    61     if (instance_==NULL)
    62       instance_ = new RNG;
     62    if (instance_==NULL) {
     63      boost::unique_lock<boost::mutex> lock(init_mutex_);
     64      if (instance_==NULL)
     65        instance_ = new RNG;
     66    }
    6367    return instance_;
    6468  }
Note: See TracChangeset for help on using the changeset viewer.