diff options
Diffstat (limited to 'src/core/core_cpu.cpp')
| -rw-r--r-- | src/core/core_cpu.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
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() { | |||
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | bool CpuBarrier::Rendezvous() { | 28 | bool CpuBarrier::Rendezvous() { |
| 29 | if (end) { | 29 | if (!Settings::values.use_multi_core) { |
| 30 | return false; | 30 | // Meaningless when running in single-core mode |
| 31 | } else { | 31 | return true; |
| 32 | } | ||
| 33 | |||
| 34 | if (!end) { | ||
| 32 | std::unique_lock<std::mutex> lock(mutex); | 35 | std::unique_lock<std::mutex> lock(mutex); |
| 33 | 36 | ||
| 34 | --cores_waiting; | 37 | --cores_waiting; |
| @@ -41,6 +44,8 @@ bool CpuBarrier::Rendezvous() { | |||
| 41 | condition.wait(lock); | 44 | condition.wait(lock); |
| 42 | return true; | 45 | return true; |
| 43 | } | 46 | } |
| 47 | |||
| 48 | return false; | ||
| 44 | } | 49 | } |
| 45 | 50 | ||
| 46 | Cpu::Cpu(std::shared_ptr<CpuBarrier> cpu_barrier, size_t core_index) | 51 | Cpu::Cpu(std::shared_ptr<CpuBarrier> cpu_barrier, size_t core_index) |