Add threading primitives.
PiperOrigin-RevId: 562649644 Change-Id: I9c35b270e4b3b50cc7eb5a152f24d71def8e2fcd
This commit is contained in:
committed by
Copybara-Service
parent
94a8705ad0
commit
6225186964
@@ -1114,6 +1114,8 @@ static mjData* _makeData(const mjModel* m) {
|
||||
}
|
||||
}
|
||||
|
||||
d->threadpool = 0;
|
||||
|
||||
return d;
|
||||
}
|
||||
|
||||
@@ -1202,6 +1204,8 @@ mjData* mj_copyData(mjData* dest, const mjModel* m, const mjData* src) {
|
||||
}
|
||||
}
|
||||
|
||||
dest->threadpool = src->threadpool;
|
||||
|
||||
return dest;
|
||||
}
|
||||
|
||||
|
||||
@@ -778,7 +778,8 @@ void mj_printFormattedData(const mjModel* m, mjData* d, const char* filename,
|
||||
#define X(type, name) \
|
||||
if (strcmp(#name, "pstack") != 0 && \
|
||||
strcmp(#name, "pbase") != 0 && \
|
||||
strcmp(#name, "parena") != 0) { \
|
||||
strcmp(#name, "parena") != 0 && \
|
||||
strcmp(#name, "threadpool") != 0) { \
|
||||
const char* format = _Generic( \
|
||||
d->name, \
|
||||
int : INT_FORMAT, \
|
||||
@@ -794,6 +795,16 @@ void mj_printFormattedData(const mjModel* m, mjData* d, const char* filename,
|
||||
|
||||
MJDATA_SCALAR
|
||||
#undef X
|
||||
|
||||
int threadpool = 0;
|
||||
if (d->threadpool) {
|
||||
threadpool = 1;
|
||||
}
|
||||
fprintf(fp, " ");
|
||||
fprintf(fp, NAME_FORMAT, "threadpool");
|
||||
fprintf(fp, INT_FORMAT, threadpool);
|
||||
fprintf(fp, "\n");
|
||||
|
||||
fprintf(fp, "\n");
|
||||
|
||||
// WARNING
|
||||
|
||||
Reference in New Issue
Block a user