]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common/Finisher: call notify_one() instead of notify_all()
authorMax Kellermann <max.kellermann@ionos.com>
Mon, 7 Oct 2024 19:22:10 +0000 (21:22 +0200)
committerMax Kellermann <max.kellermann@ionos.com>
Thu, 10 Oct 2024 05:31:52 +0000 (07:31 +0200)
As noted in commit cc7ec3e18d1, there is only ever a single `Finisher`
thread, therefore the overhead for `notify_all()` can be eliminated.

Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
src/common/Finisher.cc
src/common/Finisher.h

index 20b8829d7ecdde200f72c6a25c731f6acbbbe92e..8f2262235e89bb6172e00319610a7c74304a4c29 100644 (file)
@@ -20,7 +20,7 @@ void Finisher::stop()
   finisher_stop = true;
   // we don't have any new work to do, but we want the worker to wake up anyway
   // to process the stop condition.
-  finisher_cond.notify_all();
+  finisher_cond.notify_one();
   finisher_lock.unlock();
   finisher_thread.join(); // wait until the worker exits completely
   ldout(cct, 10) << __func__ << " finish" << dendl;
index 732ed746d56c40d8150f9a37162a104f9dfd9329..6618749b598e9094831550054371a03b2f4e2c68 100644 (file)
@@ -88,7 +88,7 @@ class Finisher {
        finisher_queue.push_back(std::make_pair(i, 0));
       }
       if (should_notify) {
-       finisher_cond.notify_all();
+       finisher_cond.notify_one();
       }
     }
     if (logger)