From 02f5b4f91d69e13cb0744cc1c3e849b0412e14a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Sun, 10 Mar 2019 16:00:12 +0100 Subject: [PATCH] Avoid superfluous `notifyAll` calls in Channel. Slightly reduces the notification overhead in multiple-reader or multiple-writer scenarios. --- source/vibe/core/channel.d | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/vibe/core/channel.d b/source/vibe/core/channel.d index c8bec6f..e6741f8 100644 --- a/source/vibe/core/channel.d +++ b/source/vibe/core/channel.d @@ -188,7 +188,7 @@ private final class ChannelImpl(T, size_t buffer_size) { thisus.m_items.popFront(); } - if (was_full) thisus.m_condition.notifyAll(); + if (was_full) thisus.m_condition.notify(); return true; } @@ -212,7 +212,7 @@ private final class ChannelImpl(T, size_t buffer_size) { thisus.m_items.popFront(); } - if (was_full) thisus.m_condition.notifyAll(); + if (was_full) thisus.m_condition.notify(); return ret.move; } @@ -235,7 +235,7 @@ private final class ChannelImpl(T, size_t buffer_size) { swap(thisus.m_items, dst); } - if (was_full) thisus.m_condition.notifyAll(); + if (was_full) thisus.m_condition.notify(); return true; } @@ -256,7 +256,7 @@ private final class ChannelImpl(T, size_t buffer_size) { thisus.m_items.put(item.move); } - if (need_notify) thisus.m_condition.notifyAll(); + if (need_notify) thisus.m_condition.notify(); } }