Commit cd8d2b0d authored by Pranjal Raihan's avatar Pranjal Raihan Committed by Facebook GitHub Bot

Fix race between PrimaryPtr::lock and PrimaryPtr::join

Reviewed By: andriigrynenko

Differential Revision: D33532498

fbshipit-source-id: bd180566563576d003afced43684a8e0cb8e3cee
parent 1c24c1b4
...@@ -164,9 +164,6 @@ class PrimaryPtr { ...@@ -164,9 +164,6 @@ class PrimaryPtr {
// was called or the cleanup() task was started (even if the call to join() // was called or the cleanup() task was started (even if the call to join()
// hasn't returned yet and the cleanup() task has not completed yet). // hasn't returned yet and the cleanup() task has not completed yet).
std::shared_ptr<T> lock() const { std::shared_ptr<T> lock() const {
if (!*this) {
return nullptr;
}
if (auto outerPtr = outerPtrWeak_.lock()) { if (auto outerPtr = outerPtrWeak_.lock()) {
return *outerPtr; return *outerPtr;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment