From 3f1d20552562e91274082e7802b143f3755debc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Toma=C5=BEi=C4=8D?= Date: Mon, 25 Oct 2021 11:52:16 +0200 Subject: [PATCH] Use max 16 threads The commit `4bb735f7966eedf414aa8e24533967cffd5bbcdb` only fixed the threading limit on the decoder part. Use the limit also in the encoder. --- crnlib/crn_threading_pthreads.cpp | 1 + crnlib/crn_threading_win32.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/crnlib/crn_threading_pthreads.cpp b/crnlib/crn_threading_pthreads.cpp index 9b1b8128..8d02d316 100644 --- a/crnlib/crn_threading_pthreads.cpp +++ b/crnlib/crn_threading_pthreads.cpp @@ -32,6 +32,7 @@ void crn_threading_init() { #else g_number_of_processors = 1; #endif + g_number_of_processors = math::minimum(g_number_of_processors, task_pool::cMaxThreads); } crn_thread_id_t crn_get_current_thread_id() { diff --git a/crnlib/crn_threading_win32.cpp b/crnlib/crn_threading_win32.cpp index d1730a37..50c114e9 100644 --- a/crnlib/crn_threading_win32.cpp +++ b/crnlib/crn_threading_win32.cpp @@ -13,6 +13,7 @@ void crn_threading_init() { GetSystemInfo(&g_system_info); g_number_of_processors = math::maximum(1U, g_system_info.dwNumberOfProcessors); + g_number_of_processors = math::minimum(g_number_of_processors, task_pool::cMaxThreads); } crn_thread_id_t crn_get_current_thread_id() {