Add maxuse_threadstack to mjData
PiperOrigin-RevId: 567334177 Change-Id: Ifd772350042e548a63ab269fd68fb5e5fef55831
This commit is contained in:
committed by
Copybara-Service
parent
be75dda8d1
commit
4f34cacf35
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "thread/thread_pool.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <atomic>
|
||||
#include <cstddef>
|
||||
#include <memory>
|
||||
@@ -55,7 +56,7 @@ class ThreadPoolImpl : public mjThreadPool {
|
||||
public:
|
||||
ThreadPoolImpl(int num_worker) : mjThreadPool{num_worker} {
|
||||
// initialize worker threads
|
||||
for (int i = 0; i < num_worker; ++i) {
|
||||
for (int i = 0; i < std::min(num_worker, mjMAXTHREADS); ++i) {
|
||||
WorkerThread worker{
|
||||
std::make_unique<std::thread>(ThreadPoolWorker, this)};
|
||||
workers_.push_back(std::move(worker));
|
||||
|
||||
Reference in New Issue
Block a user