[Lldb-commits] [PATCH] D30702: Fix remaining threading issues in Log.h

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 8 03:47:30 PST 2017


labath updated this revision to Diff 90994.
labath added a comment.

I've repurposed the stream mutex to protect the entirety of enable/disable
operations. To make this flow better, I've also gotten rid of the LogAndChannel
struct and make Channel a member of Log directly (which required moving some
declarations from the cpp file to the header).

I've also updated all atomic operations to use relaxed memory order. For the
operations in the critical section in does not matter. for the fast path in the
logging code it is enough to makee sure that the reads are atomic and once we
get around to actually writing to the log,  the read lock on the mutex will make
sure the modifications to m_stream_sp are visible to the logging thread.


https://reviews.llvm.org/D30702

Files:
  include/lldb/Utility/Log.h
  source/Utility/Log.cpp
  unittests/Utility/LogTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30702.90994.patch
Type: text/x-patch
Size: 17109 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20170308/32140372/attachment-0001.bin>


More information about the lldb-commits mailing list