Checkpoint

This commit is contained in:
Robin E. R. Davies
2025-08-01 18:24:54 -04:00
parent af5b1542b1
commit aa13301b84
16 changed files with 415 additions and 388 deletions
+8 -2
View File
@@ -163,8 +163,9 @@ void Worker::WaitForAllResponses()
std::this_thread::sleep_for(std::chrono::milliseconds(50));
std::chrono::milliseconds waitDuration = std::chrono::duration_cast<std::chrono::milliseconds>(Clock::now()-startTime);
if (waitDuration.count() > 1500) {
Lv2Log::error("Timed out waiting for a Worker task to complete.");
// better to leak than to terminate the application.
Lv2Log::error("Timed out waiting for a Worker task to complete.");
break;
}
}
}
@@ -327,7 +328,12 @@ LV2_Worker_Status HostWorkerThread::ScheduleWorkNoLock(Worker *worker, size_t si
void Worker::RunBackgroundTask(size_t size, uint8_t *data)
{
workerInterface->work(lilvInstance->lv2_handle, worker_respond_fn, (LV2_Handle)this, size, data);
try {
workerInterface->work(lilvInstance->lv2_handle, worker_respond_fn, (LV2_Handle)this, size, data);
} catch (const std::exception &e)
{
Lv2Log::error(SS("Unhandled exception on LV2 Worker thread: " << e.what()));
}
{
std::lock_guard lock { this->outstandingRequestMutex};
--this->outstandingRequests;