| 46 | |
| 47 | template<typename T> |
| 48 | void SharedThreadSafeOwner<T>::reset() |
| 49 | { |
| 50 | assert( !construction_ ); // one thread constructs the object, and this thread resets it |
| 51 | if ( !obj_ ) // fast path avoiding unnecessary writing in obj_ when it is already null |
| 52 | return; |
| 53 | atomic_store( &obj_, {} ); |
| 54 | } |
| 55 | |
| 56 | template<typename T> |
| 57 | void SharedThreadSafeOwner<T>::update( const std::function<void(T&)> & updater ) |