about summary refs log tree commit diff
path: root/third_party/nix/src/libutil/thread-pool.cc
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nix/src/libutil/thread-pool.cc')
-rw-r--r--third_party/nix/src/libutil/thread-pool.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/third_party/nix/src/libutil/thread-pool.cc b/third_party/nix/src/libutil/thread-pool.cc
index d0042c6df195..879de446c294 100644
--- a/third_party/nix/src/libutil/thread-pool.cc
+++ b/third_party/nix/src/libutil/thread-pool.cc
@@ -8,9 +8,9 @@ namespace nix {
 ThreadPool::ThreadPool(size_t _maxThreads) : maxThreads(_maxThreads) {
   restoreAffinity();  // FIXME
 
-  if (!maxThreads) {
+  if (maxThreads == 0u) {
     maxThreads = std::thread::hardware_concurrency();
-    if (!maxThreads) {
+    if (maxThreads == 0u) {
       maxThreads = 1;
     }
   }
@@ -111,8 +111,8 @@ void ThreadPool::doWork(bool mainThread) {
             try {
               std::rethrow_exception(exc);
             } catch (std::exception& e) {
-              if (!dynamic_cast<Interrupted*>(&e) &&
-                  !dynamic_cast<ThreadPoolShutDown*>(&e)) {
+              if ((dynamic_cast<Interrupted*>(&e) == nullptr) &&
+                  (dynamic_cast<ThreadPoolShutDown*>(&e) == nullptr)) {
                 ignoreException();
               }
             } catch (...) {
@@ -135,7 +135,7 @@ void ThreadPool::doWork(bool mainThread) {
         /* If there are no active or pending items, and the
            main thread is running process(), then no new items
            can be added. So exit. */
-        if (!state->active && state->draining) {
+        if ((state->active == 0u) && state->draining) {
           quit = true;
           work.notify_all();
           return;