diff --git a/autowiring/atomic_object.h b/autowiring/atomic_object.h index 3216aa54b..6c1d1f9a7 100644 --- a/autowiring/atomic_object.h +++ b/autowiring/atomic_object.h @@ -3,6 +3,7 @@ #include MUTEX_HEADER #include "unlock_object.h" + template class unlock_object; /// @@ -24,7 +25,6 @@ class atomic_object { typedef std::shared_ptr> shared; protected: - //CONTRACT: If !m_initialized then m_object == object(); mutable lock m_lock; object m_object; @@ -35,12 +35,8 @@ class atomic_object { atomic_object() {}; /// - ///Initialization yielding initialized() == source.initialized(). + ///Thread-safe copy constructor /// - /// - ///Intermediate copies can be avoided during construction using: - /// atomic_object target(*unlock_object(source)); - /// atomic_object(const atomic_object& source) { std::lock_guard lock_source(source.m_lock); m_object = source.m_object; @@ -75,7 +71,7 @@ class atomic_object { } /// - ///Assignment yielding initialized() == true. + ///Assignment overload /// atomic_object& operator = (const object& source) { std::lock_guard lock_this(m_lock);