Skip to content

Commit

Permalink
Update xatlas.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
benedetto73 authored Aug 8, 2023
1 parent 2dcfdaf commit eb56d72
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions xatlas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3235,7 +3235,7 @@ class sync_unordered_map {
}
};

const uint64_t defaultConcurrency = std::thread::hardware_concurrency() <= 1 ? 1 : std::thread::hardware_concurrency() - 1;
const uint64_t maxConcurrency = std::thread::hardware_concurrency() <= 1 ? 1 : std::thread::hardware_concurrency() - 1;

#if XA_MULTITHREADED
class TaskScheduler
Expand All @@ -3260,9 +3260,10 @@ class TaskScheduler
TaskGroup(const TaskGroup&) = default;
};
public:
TaskScheduler(uint64_t threadPoolSize = defaultConcurrency) : m_shutdown(false)
TaskScheduler(uint64_t threadPoolSize = maxConcurrency) : m_shutdown(false)
{
m_threadIndex = 0;
threadPoolSize = std::min(threadPoolSize, maxConcurrency);
m_workers.resize(threadPoolSize);
for (uint64_t i = 0; i < m_workers.size(); i++) {
new (&m_workers[i]) Worker();
Expand Down

0 comments on commit eb56d72

Please sign in to comment.