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

2017-03-09 Thread Pavel Labath via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL297368: Fix remaining threading issues in Log.h (authored by labath). Changed prior to commit: https://reviews.llvm.org/D30702?vs=90994&id=91147#toc Repository: rL LLVM https://reviews.llvm.org/D307

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

2017-03-09 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment. Comment at: source/Utility/Log.cpp:82 + if (mask | flags) { +m_options.store(options, std::memory_order_release); +m_stream_sp = stream_sp; zturner wrote: > Might as well use `memory_order_relaxed` here. Done. I missed that one

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

2017-03-08 Thread Zachary Turner via Phabricator via lldb-commits
zturner accepted this revision. zturner added inline comments. Comment at: source/Utility/Log.cpp:82 + if (mask | flags) { +m_options.store(options, std::memory_order_release); +m_stream_sp = stream_sp; Might as well use `memory_order_relaxed` here. ==

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

2017-03-08 Thread Pavel Labath via Phabricator via lldb-commits
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 som

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

2017-03-08 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment. Comment at: include/lldb/Utility/Log.h:152 - Flags &GetOptions(); + const Flags GetOptions() const; eugene wrote: > Seems like const on return value is not really needed. Well... otherwise people could write something like: `log.

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

2017-03-07 Thread Zachary Turner via Phabricator via lldb-commits
zturner added inline comments. Comment at: source/Utility/Log.cpp:90-91 uint32_t options, uint32_t flags) { - log.GetMask().Set(flags); - if (log.GetMask().Get()) { -log.GetOptions().Reset(options); + uint32_t mask = log.m_mask.load(std::memory_o

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

2017-03-07 Thread Eugene Zemtsov via Phabricator via lldb-commits
eugene added inline comments. Comment at: include/lldb/Utility/Log.h:152 - Flags &GetOptions(); + const Flags GetOptions() const; Seems like const on return value is not really needed. Comment at: include/lldb/Utility/Log.h:163 + std::at

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

2017-03-07 Thread Greg Clayton via Phabricator via lldb-commits
clayborg accepted this revision. clayborg added a comment. This revision is now accepted and ready to land. With my limited std::atomic experience, this seems fine. https://reviews.llvm.org/D30702 ___ lldb-commits mailing list lldb-commits@lists.llv

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

2017-03-07 Thread Pavel Labath via Phabricator via lldb-commits
labath created this revision. 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,