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
+1 -6
View File
@@ -218,8 +218,7 @@ int main(int argc, char** argv) {
// make and bind threadpool
if (npoolthread > 1) {
mjThreadPool* threadpool = mju_threadPoolCreate(npoolthread);
mju_bindThreadPool(d[id], threadpool);
mju_threadpool(d[id], npoolthread);
}
}
@@ -348,11 +347,7 @@ int main(int argc, char** argv) {
// free per-thread data
for (int id=0; id < nthread; id++) {
mjThreadPool* threadpool = (mjThreadPool*) d[id]->threadpool;
mj_deleteData(d[id]);
if (threadpool) {
mju_threadPoolDestroy(threadpool);
}
}
// finalize