MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / reset

Method reset

source/MRMesh/MRUniqueThreadSafeOwner.cpp:65–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63
64template<typename T>
65void UniqueThreadSafeOwner<T>::reset()
66{
67 if ( !obj_ ) // fast path avoiding locking and unnecessary writing in obj_ when it is already null
68 return;
69 std::unique_lock lock( mutex_ );
70 assert( !construction_ ); // one thread constructs the object, and this thread resets it
71 obj_.reset();
72}
73
74template<typename T>
75void UniqueThreadSafeOwner<T>::update( const std::function<void(T&)> & updater )

Callers 2

UniqueThreadSafeOwnerMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected