
26 Jan
2010
26 Jan
'10
6:03 p.m.
Thread-safe (instance_ == NULL) comparison: static T& Instance() { /** Perform the Double-Check pattern. See http://www.research.ibm.com/designpatterns/pubs/ph-jun96.txt. */ if (instance_ == NULL) { boost::mutex::scoped_lock locker(mtx_instance_); if (instance_ == NULL) { instance_ = new T(); destroyer_.set_doomed(instance_); } } return *instance_; } -- View this message in context: http://old.nabble.com/-Boost.utility--tp27309940p27327050.html Sent from the Boost - Dev mailing list archive at Nabble.com.