folly::PrimaryPtrRef::lock

Attempts to lock a pointer.

Synopsis

Declared in <folly/concurrency/memory/PrimaryPtr.h>

std::shared_ptr<T>
lock() const;

Description

Returns null if pointer is not set or if join() was called or cleanup() work was started (even if the call to join() hasn't returned yet or the cleanup() work has not completed yet).

Return Value

A shared pointer to the object, or null if unavailable.