From 9bf2a428f9e9359763be1bfd90c32371044c711e Mon Sep 17 00:00:00 2001 From: bunnei Date: Thu, 3 May 2018 00:34:54 -0400 Subject: core: Add a configuration setting for use_multi_core. --- src/core/core_cpu.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/core/core_cpu.cpp') diff --git a/src/core/core_cpu.cpp b/src/core/core_cpu.cpp index bd9869d28..099f2bb1a 100644 --- a/src/core/core_cpu.cpp +++ b/src/core/core_cpu.cpp @@ -26,9 +26,12 @@ void CpuBarrier::NotifyEnd() { } bool CpuBarrier::Rendezvous() { - if (end) { - return false; - } else { + if (!Settings::values.use_multi_core) { + // Meaningless when running in single-core mode + return true; + } + + if (!end) { std::unique_lock lock(mutex); --cores_waiting; @@ -41,6 +44,8 @@ bool CpuBarrier::Rendezvous() { condition.wait(lock); return true; } + + return false; } Cpu::Cpu(std::shared_ptr cpu_barrier, size_t core_index) -- cgit v1.2.3