Files
ppsspp/UWP/UWPHelpers/StorageAsync.cpp

27 lines
557 B
C++
Raw Permalink Normal View History

2023-04-28 23:22:17 +04:00
// Thanks to RetroArch/Libretro team for this idea
// This is improved version of the original idea
#include "StorageAsync.h"
bool ActionPass(Windows::Foundation::IAsyncAction^ action)
{
2023-04-30 08:54:54 +04:00
try {
return TaskHandler<bool>([&]() {
return concurrency::create_task(action).then([]() {
return true;
});
}, false);
}
catch (...) {
return false;
}
2023-04-28 23:22:17 +04:00
}
// Async action such as 'Delete' file
// @action: async action
// return false when action failed
bool ExecuteTask(Windows::Foundation::IAsyncAction^ action)
{
return ActionPass(action);
};