cesium-native
cesium-native copied to clipboard
Add AsyncSystem::waitInMainThread
Adds a new method, waitInMainThread, to AsyncSystem.
Calling asyncSystem.waitInMainThread(std::move(future)) is similar to calling future.wait(). Both wait for the future to resolve or reject, and then either return the value or throw an exception. waitInMainThread also continues to dispatch main thread tasks while waiting, however. This means that it is safe to call from the main thread even if the future has thenInMainThread continuations. future.wait(), on the other hand, is very likely to deadlock in this situation.