Commit ecb501b7 authored by Sarang Masti's avatar Sarang Masti Committed by Facebook Github Bot

Fix incorrect usages of folly::Synchronized

Summary:
We need to keep LockedPtr returned by rlock/wlock alive for the entire duration
of the loop. Else we are working on a snapshot of the data structure, which
might not be what we want.

Reviewed By: aary, ot, luciang

Differential Revision: D6426613

fbshipit-source-id: 294c0a7b9d756f3116d5cdb3a7b3678f693e0754
parent d017a3ff
......@@ -22,7 +22,8 @@
namespace folly { namespace detail {
EventBaseLocalBase::~EventBaseLocalBase() {
for (auto* evb : *eventBases_.rlock()) {
auto locked = eventBases_.rlock();
for (auto* evb : *locked) {
evb->runInEventBaseThread([ this, evb, key = key_ ] {
evb->localStorage_.erase(key);
evb->localStorageToDtor_.erase(this);
......
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