llvm-project/lldb/unittests
Pavel Labath f5aaa999b9 Fix remaining threading issues in Log.h
Summary:
This fixes two threading issues in the logging code. The access to the
mask and options flags had data races when we were trying to
enable/disable logging while another thread was writing to the log.
Since we can log from almost any context, and we want it to be fast, so
I avoided locking primitives and used atomic variables instead. I have
also removed the (unused) setters for the mask and flags to make sure
that the only way to set them is through the enable/disable channel
functions.

I also add tests, which when run under tsan, verify that the use cases
like "doing an LLDB_LOGV while another thread disables logging" are
data-race-free.

Reviewers: zturner, clayborg

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D30702

llvm-svn: 297368
2017-03-09 10:16:07 +00:00
..
Breakpoint Move classes from Core -> Utility. 2017-02-02 21:39:50 +00:00
Core Move many other files from Core -> Utility. 2017-03-06 18:34:25 +00:00
Editline Finish breaking the dependency from Utility. 2017-02-16 19:38:21 +00:00
Expression [Windows] Remove the #include <eh.h> hack. 2017-03-03 20:21:59 +00:00
Host [Windows] Remove the #include <eh.h> hack. 2017-03-03 20:21:59 +00:00
Interpreter Modernize Enable/DisableLogChannel interface a bit 2017-03-01 10:08:40 +00:00
Language [CMake] Update unit tests with accurate dependencies 2017-02-01 22:17:00 +00:00
ObjectFile Move DataBuffer / DataExtractor and friends from Core -> Utility. 2017-03-04 01:30:05 +00:00
Platform [CMake] Update unit tests with accurate dependencies 2017-02-01 22:17:00 +00:00
Process Make LLDB skip server-client roundtrip for signals that don't require any actions 2017-03-07 21:34:40 +00:00
ScriptInterpreter [CMake] Update unit tests with accurate dependencies 2017-02-01 22:17:00 +00:00
Signals Make LLDB skip server-client roundtrip for signals that don't require any actions 2017-03-07 21:34:40 +00:00
Symbol [CMake] Update unit tests with accurate dependencies 2017-02-01 22:17:00 +00:00
SymbolFile Attempt to fix windows unit tests 2017-02-24 11:17:40 +00:00
Target Add format_provider for the MemoryRegionInfo::OptionalBool enum 2017-02-22 10:37:57 +00:00
UnwindAssembly [CMake] Update unit tests with accurate dependencies 2017-02-01 22:17:00 +00:00
Utility Fix remaining threading issues in Log.h 2017-03-09 10:16:07 +00:00
CMakeLists.txt Make LLDB skip server-client roundtrip for signals that don't require any actions 2017-03-07 21:34:40 +00:00
gtest_common.h [Windows] Remove the #include <eh.h> hack. 2017-03-03 20:21:59 +00:00