This is an archive of the discontinued LLVM Phabricator instance.

Make SymbolFileDWARF::GetCachedSectionData thread safe
ClosedPublic

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

Diff Detail

Repository
rL LLVM

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.

source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
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.