diff options
author | Pavel Labath <pavel@labath.sk> | 2022-01-17 15:04:30 +0100 |
---|---|---|
committer | Pavel Labath <pavel@labath.sk> | 2022-01-19 16:42:53 +0100 |
commit | 4f89157b9d73711a7ce20b597f93eb17a3133adf (patch) | |
tree | 6f4612e48222b42294a0908e68679ed9dea4f8d7 /lldb/source/Plugins/ScriptInterpreter/Python | |
parent | e35c8f541cfab0747429063f6b5acf47cff17b6d (diff) | |
download | llvm-4f89157b9d73711a7ce20b597f93eb17a3133adf.zip llvm-4f89157b9d73711a7ce20b597f93eb17a3133adf.tar.gz llvm-4f89157b9d73711a7ce20b597f93eb17a3133adf.tar.bz2 |
[lldb] Make StatsDuration thread-safe
std::chrono::duration types are not thread-safe, and they cannot be
concurrently updated from multiple threads. Currently, we were doing
such a thing (only) in the DWARF indexing code
(DWARFUnit::ExtractDIEsRWLocked), but I think it can easily happen that
someone else tries to update another statistic like this without
bothering to check for thread safety.
This patch changes the StatsDuration type from a simple typedef into a
class in its own right. The class stores the duration internally as
std::atomic<uint64_t> (so it can be updated atomically), but presents it
to its users as the usual chrono type (duration<float>).
Differential Revision: https://reviews.llvm.org/D117474
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python')
0 files changed, 0 insertions, 0 deletions