FastLED 3.9.15
Loading...
Searching...
No Matches

◆ lock()

template<typename T>
shared_ptr< T > fl::weak_ptr< T >::lock ( ) const
inlinenoexcept

Definition at line 139 of file weak_ptr.h.

139 {
140 if (expired()) {
141 return shared_ptr<T>();
142 }
143
144 // Try to acquire the shared pointer atomically
145 if (control_block_ && control_block_->shared_count > 0) {
146 ++control_block_->shared_count;
148 }
149 return shared_ptr<T>();
150 }
detail::ControlBlockBase * control_block_
Definition weak_ptr.h:13
friend class shared_ptr
Definition weak_ptr.h:192
bool expired() const noexcept
Definition weak_ptr.h:135

References control_block_, expired(), ptr_, and shared_ptr.

+ Here is the call graph for this function: