Add new mju_threadpool API function, and delete old threading API.
PiperOrigin-RevId: 922838541 Change-Id: Id9f7e0fb298ffde61fcc49a802dc78971858ce51
This commit is contained in:
committed by
Copybara-Service
parent
a22fc2423a
commit
b935d4153c
+1
-6
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user