1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-13 13:31:48 +00:00

Fix deadlock in EditorFileSystem::reimport_files.

This commit is contained in:
Pāvels Nadtočajevs
2025-06-17 12:45:02 +03:00
parent 46c495ca21
commit 507cb47f97

View File

@@ -3247,12 +3247,14 @@ void EditorFileSystem::reimport_files(const Vector<String> &p_files) {
WorkerThreadPool::GroupID group_task = WorkerThreadPool::get_singleton()->add_template_group_task(this, &EditorFileSystem::_reimport_thread, &tdata, item_count, -1, false, vformat(TTR("Import resources of type: %s"), reimport_files[from].importer)); WorkerThreadPool::GroupID group_task = WorkerThreadPool::get_singleton()->add_template_group_task(this, &EditorFileSystem::_reimport_thread, &tdata, item_count, -1, false, vformat(TTR("Import resources of type: %s"), reimport_files[from].importer));
int imported_count = 0; int imported_count = 0;
while (true) {
while (true) { while (true) {
ep->step(reimport_files[imported_count].path.get_file(), from + imported_count, false); ep->step(reimport_files[imported_count].path.get_file(), from + imported_count, false);
imported_sem.wait(); if (imported_sem.try_wait()) {
do {
imported_count++; imported_count++;
} while (imported_sem.try_wait()); break;
}
}
if (imported_count == item_count) { if (imported_count == item_count) {
break; break;
} }