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

◆ lock()

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

Definition at line 140 of file weak_ptr.h.

140 {
141 if (expired()) {
142 return shared_ptr<T>();
143 }
144
145 // Try to acquire the shared pointer atomically
146 if (mControlBlock && mControlBlock->shared_count > 0) {
147 ++mControlBlock->shared_count;
149 }
150 return shared_ptr<T>();
151 }
detail::ControlBlockBase * mControlBlock
Definition weak_ptr.h:14
bool expired() const FL_NOEXCEPT
Definition weak_ptr.h:136
friend class shared_ptr
Definition weak_ptr.h:193

References expired(), FL_NOEXCEPT, mControlBlock, mPtr, and shared_ptr.

Referenced by fl::audio::Processor::createWithAutoInput(), and fl::Gamma8::getOrCreate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: