Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Galileo53 |
Godot 3.0.3
Godot documentation gives an example class “resource_queue.gd” in chapter “Background loading”.
There is a function “_wait_for_resources”:
func _wait_for_resource(res, path):
_unlock("wait_for_resource")
while true:
VS.flush()
OS.delay_usec(16000) # wait 1 frame
_lock("wait_for_resource")
if queue.size() == 0 || queue[0] != res:
return pending[path]
_unlock("wait_for_resource")
that should wait until the resource is loaded by a separate thread “thread_process”.
The code does not work because
VS.flush()
will throw an error because VS does not exist. Also an OS.flush does not exist.
When removing this line from code the system crashes, probably a deadlock, because this function will loop forever.
Has anybody had success with this example or does anybody know what “VS.flush()” means ?
cant delete comment, see answer below…
meigel | 2018-08-25 20:06