From 39087321811e81e26a1a47d6967df1088dcf0e95 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 19 May 2020 20:47:23 +0100 Subject: style(3p/nix): Final act in the brace-wrapping saga This last change set was generated by a full clang-tidy run (including compilation): clang-tidy -p ~/projects/nix-build/ \ -checks=-*,readability-braces-around-statements -fix src/*/*.cc Actually running clang-tidy requires some massaging to make it play nice with Nix + meson, I'll be adding a wrapper or something for that soon. --- third_party/nix/src/libutil/thread-pool.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'third_party/nix/src/libutil/thread-pool.cc') diff --git a/third_party/nix/src/libutil/thread-pool.cc b/third_party/nix/src/libutil/thread-pool.cc index a16f4c2b6033..d0042c6df195 100644 --- a/third_party/nix/src/libutil/thread-pool.cc +++ b/third_party/nix/src/libutil/thread-pool.cc @@ -50,8 +50,9 @@ void ThreadPool::enqueue(const work_t& t) { state->pending.push(t); /* Note: process() also executes items, so count it as a worker. */ if (state->pending.size() > state->workers.size() + 1 && - state->workers.size() + 1 < maxThreads) + state->workers.size() + 1 < maxThreads) { state->workers.emplace_back(&ThreadPool::doWork, this, false); + } work.notify_one(); } @@ -111,8 +112,9 @@ void ThreadPool::doWork(bool mainThread) { std::rethrow_exception(exc); } catch (std::exception& e) { if (!dynamic_cast(&e) && - !dynamic_cast(&e)) + !dynamic_cast(&e)) { ignoreException(); + } } catch (...) { } } -- cgit 1.4.1