Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions FWCore/Utilities/interface/ReusableObjectHolder.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,12 @@ namespace edm {
if (m_availableQueue.try_pop(item)) {
return wrapCustomDeleter(std::move(item));
} else {
return std::shared_ptr<T>{};
//try a second time as try_pop can have a false failure
if (m_availableQueue.try_pop(item)) {
return wrapCustomDeleter(std::move(item));
} else {
return std::shared_ptr<T>{};
}
}
}

Expand All @@ -124,7 +129,12 @@ namespace edm {
if (m_availableQueue.try_pop(item)) {
return wrapCustomDeleter(std::move(item));
} else {
return wrapCustomDeleter(makeUnique(iMakeFunc()));
//try a second time as try_pop can have a false failure
if (m_availableQueue.try_pop(item)) {
return wrapCustomDeleter(std::move(item));
} else {
return wrapCustomDeleter(makeUnique(iMakeFunc()));
}
}
}

Expand Down