about summary refs log tree commit diff
path: root/third_party/nix/src/libutil/thread-pool.cc
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-05-19T19·47+0100
committerVincent Ambo <tazjin@google.com>2020-05-19T19·51+0100
commit39087321811e81e26a1a47d6967df1088dcf0e95 (patch)
tree57110be423eeb7869e9960466f4b17c0ea7cd961 /third_party/nix/src/libutil/thread-pool.cc
parentcf40d08908ede4061eb15513b770c98877844b8b (diff)
style(3p/nix): Final act in the brace-wrapping saga r/777
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.
Diffstat (limited to 'third_party/nix/src/libutil/thread-pool.cc')
-rw-r--r--third_party/nix/src/libutil/thread-pool.cc6
1 files changed, 4 insertions, 2 deletions
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<Interrupted*>(&e) &&
-                  !dynamic_cast<ThreadPoolShutDown*>(&e))
+                  !dynamic_cast<ThreadPoolShutDown*>(&e)) {
                 ignoreException();
+              }
             } catch (...) {
             }
           }