| 2431 | } |
| 2432 | |
| 2433 | void Simulate::Load(mjModel *m, mjData *d, const char *displayed_filename) |
| 2434 | { |
| 2435 | this->mnew_ = m; |
| 2436 | this->dnew_ = d; |
| 2437 | mju::strcpy_arr(this->filename, displayed_filename); |
| 2438 | |
| 2439 | { |
| 2440 | MutexLock lock(mtx); |
| 2441 | this->loadrequest = 2; |
| 2442 | |
| 2443 | // Wait for the render thread to be done loading |
| 2444 | // so that we know the old model and data's memory can |
| 2445 | // be free'd by the other thread (sometimes python) |
| 2446 | cond_loadrequest.wait(lock, [this]() |
| 2447 | { return this->loadrequest == 0; }); |
| 2448 | } |
| 2449 | } |
| 2450 | |
| 2451 | void Simulate::LoadMessageClear(void) |
| 2452 | { |
no test coverage detected