From eb11fae6d08f479c0799db45860a98af528fa6e7 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 28 Jul 2018 10:51:19 +0000 Subject: Vendor import of llvm trunk r338150: https://llvm.org/svn/llvm-project/llvm/trunk@338150 --- include/llvm/Support/Parallel.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include/llvm/Support/Parallel.h') diff --git a/include/llvm/Support/Parallel.h b/include/llvm/Support/Parallel.h index 6bc0a6bbaf2b..1462265343be 100644 --- a/include/llvm/Support/Parallel.h +++ b/include/llvm/Support/Parallel.h @@ -56,12 +56,12 @@ public: ~Latch() { sync(); } void inc() { - std::unique_lock lock(Mutex); + std::lock_guard lock(Mutex); ++Count; } void dec() { - std::unique_lock lock(Mutex); + std::lock_guard lock(Mutex); if (--Count == 0) Cond.notify_all(); } @@ -100,7 +100,7 @@ void parallel_for_each_n(IndexTy Begin, IndexTy End, FuncTy Fn) { #else const ptrdiff_t MinParallelSize = 1024; -/// \brief Inclusive median. +/// Inclusive median. template RandomAccessIterator medianOf3(RandomAccessIterator Start, RandomAccessIterator End, @@ -118,7 +118,7 @@ void parallel_quick_sort(RandomAccessIterator Start, RandomAccessIterator End, const Comparator &Comp, TaskGroup &TG, size_t Depth) { // Do a sequential sort for small inputs. if (std::distance(Start, End) < detail::MinParallelSize || Depth == 0) { - std::sort(Start, End, Comp); + llvm::sort(Start, End, Comp); return; } @@ -200,7 +200,7 @@ void sort(Policy policy, RandomAccessIterator Start, RandomAccessIterator End, const Comparator &Comp = Comparator()) { static_assert(is_execution_policy::value, "Invalid execution policy!"); - std::sort(Start, End, Comp); + llvm::sort(Start, End, Comp); } template -- cgit v1.2.3