CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
hrydgard

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: hrydgard/ppsspp
Path: blob/master/UWP/UWPHelpers/StorageAsync.cpp
Views: 1401
1
// Thanks to RetroArch/Libretro team for this idea
2
// This is improved version of the original idea
3
4
#include "StorageAsync.h"
5
6
bool ActionPass(Windows::Foundation::IAsyncAction^ action)
7
{
8
try {
9
return TaskHandler<bool>([&]() {
10
return concurrency::create_task(action).then([]() {
11
return true;
12
});
13
}, false);
14
}
15
catch (...) {
16
return false;
17
}
18
}
19
20
// Async action such as 'Delete' file
21
// @action: async action
22
// return false when action failed
23
bool ExecuteTask(Windows::Foundation::IAsyncAction^ action)
24
{
25
return ActionPass(action);
26
};
27
28