Add new mju_threadpool API function, and delete old threading API.

PiperOrigin-RevId: 922838541
Change-Id: Id9f7e0fb298ffde61fcc49a802dc78971858ce51
This commit is contained in:
Kyle Bayes
2026-05-28 10:09:07 -07:00
committed by Copybara-Service
parent a22fc2423a
commit b935d4153c
47 changed files with 576 additions and 1755 deletions
+7 -1
View File
@@ -153,6 +153,7 @@ class Simulate {
std::optional<std::string> save_mjb;
std::optional<std::string> print_model;
std::optional<std::string> print_data;
bool update_threadpool;
bool reset;
bool align;
bool copy_key;
@@ -205,6 +206,10 @@ class Simulate {
// simulation
int run = 1;
// number of workers in threadpool
int nthread = 0;
// atomics for cross-thread messages
std::atomic_int exitrequest = 0;
std::atomic_int droploadrequest = 0;
@@ -320,9 +325,10 @@ class Simulate {
// simulation section of UI
const mjuiDef def_simulation[14] = {
const mjuiDef def_simulation[15] = {
{mjITEM_SECTION, "Simulation", mjPRESERVE, nullptr, "AS"},
{mjITEM_RADIO, "", 5, &this->run, "Pause\nRun"},
{mjITEM_EDITINT, "Num threads", 5, &this->nthread, "1"},
{mjITEM_BUTTON, "Reset", 2, nullptr, " #259"},
{mjITEM_BUTTON, "Reload", 5, nullptr, "CL"},
{mjITEM_BUTTON, "Align", 2, nullptr, "CA"},