Merge pull request #96904 from RandomShaper/fix_previewer_deadlock
ResourceLoader: Fix deadlocks caused by the resource changed feature
This commit is contained in:
commit
46d9db565b
2 changed files with 4 additions and 2 deletions
|
@ -860,7 +860,7 @@ Ref<Resource> ResourceLoader::_load_complete_inner(LoadToken &p_load_token, Erro
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
core_bind::Semaphore done;
|
core_bind::Semaphore done;
|
||||||
MessageQueue::get_main_singleton()->push_callable(callable_mp(&done, &core_bind::Semaphore::post));
|
MessageQueue::get_main_singleton()->push_callable(callable_mp(&done, &core_bind::Semaphore::post).bind(1));
|
||||||
done.wait();
|
done.wait();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -533,8 +533,10 @@ void EditorResourcePreview::stop() {
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!exited.is_set()) {
|
while (!exited.is_set()) {
|
||||||
|
// Sync pending work.
|
||||||
OS::get_singleton()->delay_usec(10000);
|
OS::get_singleton()->delay_usec(10000);
|
||||||
RenderingServer::get_singleton()->sync(); //sync pending stuff, as thread may be blocked on rendering server
|
RenderingServer::get_singleton()->sync();
|
||||||
|
MessageQueue::get_singleton()->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
thread.wait_to_finish();
|
thread.wait_to_finish();
|
||||||
|
|
Loading…
Reference in a new issue