mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 22:10:05 +00:00
Load radar data asynchronously
This commit is contained in:
parent
803a25e884
commit
3625515b8a
6 changed files with 71 additions and 13 deletions
16
wxdata/include/scwx/util/threads.hpp
Normal file
16
wxdata/include/scwx/util/threads.hpp
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#include <future>
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
namespace util
|
||||
{
|
||||
|
||||
template<class F>
|
||||
void async(F&& f)
|
||||
{
|
||||
auto future = std::make_shared<std::future<void>>();
|
||||
*future = std::async(std::launch::async, [future, f]() { f(); });
|
||||
}
|
||||
|
||||
} // namespace util
|
||||
} // namespace scwx
|
||||
Loading…
Add table
Add a link
Reference in a new issue