diff options
| author | Pavel Labath <labath@google.com> | 2017-03-09 10:16:07 +0000 |
|---|---|---|
| committer | Pavel Labath <labath@google.com> | 2017-03-09 10:16:07 +0000 |
| commit | f5aaa999b94a4f52df28660b9b0bdba5888bb5ea (patch) | |
| tree | 59c39637e58fb8e17721eac6cab6cf6044a13ec7 /clang/lib/Frontend/CompilerInvocation.cpp | |
| parent | 8247fefead08c70e4256ced84e83b34f27516c77 (diff) | |
| download | llvm-f5aaa999b94a4f52df28660b9b0bdba5888bb5ea.zip llvm-f5aaa999b94a4f52df28660b9b0bdba5888bb5ea.tar.gz llvm-f5aaa999b94a4f52df28660b9b0bdba5888bb5ea.tar.bz2 | |
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
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions
