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

Merge pull request #107620 from bruvzg/imp_deadlock

Fix deadlock in `EditorFileSystem::reimport_files`.
This commit is contained in:
Thaddeus Crews
2025-06-18 18:14:02 -05:00

View File

@@ -3261,12 +3261,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;
} }