<div dir="ltr">Thanks!</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 10, 2017 at 10:39 AM, Zachary Turner via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: zturner<br>
Date: Wed May 10 12:39:18 2017<br>
New Revision: 302697<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=302697&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=302697&view=rev</a><br>
Log:<br>
Rename variables to conform to LLVM naming conventions.<br>
<br>
Modified:<br>
lld/trunk/include/lld/Core/<wbr>TaskGroup.h<br>
lld/trunk/lib/Core/TaskGroup.<wbr>cpp<br>
<br>
Modified: lld/trunk/include/lld/Core/<wbr>TaskGroup.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/TaskGroup.h?rev=302697&r1=302696&r2=302697&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lld/trunk/include/lld/<wbr>Core/TaskGroup.h?rev=302697&<wbr>r1=302696&r2=302697&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lld/trunk/include/lld/Core/<wbr>TaskGroup.h (original)<br>
+++ lld/trunk/include/lld/Core/<wbr>TaskGroup.h Wed May 10 12:39:18 2017<br>
@@ -25,40 +25,40 @@ namespace lld {<br>
///<br>
/// Calling dec() on a Latch with a count of 0 has undefined behaivor.<br>
class Latch {<br>
- uint32_t _count;<br>
- mutable std::mutex _condMut;<br>
- mutable std::condition_variable _cond;<br>
+ uint32_t Count;<br>
+ mutable std::mutex Mutex;<br>
+ mutable std::condition_variable Cond;<br>
<br>
public:<br>
- explicit Latch(uint32_t count = 0) : _count(count) {}<br>
+ explicit Latch(uint32_t count = 0) : Count(count) {}<br>
~Latch() { sync(); }<br>
<br>
void inc() {<br>
- std::unique_lock<std::mutex> lock(_condMut);<br>
- ++_count;<br>
+ std::unique_lock<std::mutex> lock(Mutex);<br>
+ ++Count;<br>
}<br>
<br>
void dec() {<br>
- std::unique_lock<std::mutex> lock(_condMut);<br>
- if (--_count == 0)<br>
- _cond.notify_all();<br>
+ std::unique_lock<std::mutex> lock(Mutex);<br>
+ if (--Count == 0)<br>
+ Cond.notify_all();<br>
}<br>
<br>
void sync() const {<br>
- std::unique_lock<std::mutex> lock(_condMut);<br>
- _cond.wait(lock, [&] { return _count == 0; });<br>
+ std::unique_lock<std::mutex> lock(Mutex);<br>
+ Cond.wait(lock, [&] { return Count == 0; });<br>
}<br>
};<br>
<br>
/// \brief Allows launching a number of tasks and waiting for them to finish<br>
/// either explicitly via sync() or implicitly on destruction.<br>
class TaskGroup {<br>
- Latch _latch;<br>
+ Latch L;<br>
<br>
public:<br>
- void spawn(std::function<void()> f);<br>
+ void spawn(std::function<void()> F);<br>
<br>
- void sync() const { _latch.sync(); }<br>
+ void sync() const { L.sync(); }<br>
};<br>
}<br>
<br>
<br>
Modified: lld/trunk/lib/Core/TaskGroup.<wbr>cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Core/TaskGroup.cpp?rev=302697&r1=302696&r2=302697&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lld/trunk/lib/Core/<wbr>TaskGroup.cpp?rev=302697&r1=<wbr>302696&r2=302697&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lld/trunk/lib/Core/TaskGroup.<wbr>cpp (original)<br>
+++ lld/trunk/lib/Core/TaskGroup.<wbr>cpp Wed May 10 12:39:18 2017<br>
@@ -132,10 +132,10 @@ Executor *Executor::getDefaultExecutor(<wbr>)<br>
#endif<br>
}<br>
<br>
-void TaskGroup::spawn(std::<wbr>function<void()> f) {<br>
- _latch.inc();<br>
- Executor::getDefaultExecutor()<wbr>->add([&, f] {<br>
- f();<br>
- _latch.dec();<br>
+void TaskGroup::spawn(std::<wbr>function<void()> F) {<br>
+ L.inc();<br>
+ Executor::getDefaultExecutor()<wbr>->add([&, F] {<br>
+ F();<br>
+ L.dec();<br>
});<br>
}<br>
<br>
<br>
______________________________<wbr>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>