File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -869,7 +869,7 @@ template <typename T> T wait(Context &ctx, std::future<T> &f) {
869869 * Context ctx = waitForContextFuture(contextFuture);
870870 * @endcode
871871 */
872- template <typename T> T waitForContextFuture (std::future<T> &f) {
872+ template <typename T> T waitForContextFuture (std::future<T> &f, size_t sleepTime = 10 ) {
873873#ifdef __EMSCRIPTEN__
874874 while (f.wait_for (std::chrono::milliseconds (0 )) !=
875875 std::future_status::ready) {
@@ -879,7 +879,7 @@ template <typename T> T waitForContextFuture(std::future<T> &f) {
879879#else
880880 while (f.wait_for (std::chrono::milliseconds (0 )) !=
881881 std::future_status::ready) {
882- std::this_thread::sleep_for (std::chrono::milliseconds (10 ));
882+ std::this_thread::sleep_for (std::chrono::milliseconds (sleepTime ));
883883 }
884884 return f.get ();
885885#endif
You can’t perform that action at this time.
0 commit comments