Page MenuHomePhabricator

Make SymbolFileDWARF::GetCachedSectionData thread safe

Authored by tberghammer on Oct 21 2015, 6:42 AM.

Diff Detail


Event Timeline

tberghammer retitled this revision from to Make SymbolFileDWARF::GetCachedSectionData thread safe.
tberghammer updated this object.
tberghammer added reviewers: labath, clayborg.
tberghammer added a subscriber: lldb-commits.

Use std::call_once instead of a std::atomic+std::mutex combination based on some offline discussion with Pavel

clayborg accepted this revision.Oct 21 2015, 10:47 AM
clayborg edited edge metadata.

Looks good.

This revision is now accepted and ready to land.Oct 21 2015, 10:47 AM
labath accepted this revision.Oct 22 2015, 1:48 AM
labath edited edge metadata.

The new version of the patch looks much cleaner than the old one. Thanks.

641 ↗(On Diff #38019)

shorter and probably more efficient:
std::call_once(m_flag, &SFD::LoadSectionData, this, sect_type, std::ref(data_segment.m_data));

This revision was automatically updated to reflect the committed changes.