galaxy
1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
Async.hpp
Go to the documentation of this file.
1
7
8
#ifndef GALAXY_ASYNC_ASYNC_HPP_
9
#define GALAXY_ASYNC_ASYNC_HPP_
10
11
#include <chrono>
12
#include <future>
13
14
using namespace
std::chrono_literals;
15
16
namespace
galaxy
17
{
18
namespace
async
19
{
29
template
<
typename
T =
void
>
30
[[nodiscard]]
31
inline
bool
is_work_done
(
const
std::future<T>& task)
noexcept
32
{
33
return
task.wait_for(0s) == std::future_status::ready;
34
}
35
}
// namespace async
36
}
// namespace galaxy
37
38
#endif
galaxy::async::is_work_done
bool is_work_done(const std::future< T > &task) noexcept
Check if an async thread has finished or not.
Definition
Async.hpp:31
galaxy
Timer.hpp galaxy.
Definition
Async.hpp:17
galaxy
src
galaxy
async
Async.hpp
Generated on Sat Mar 1 2025 14:49:36 for galaxy by
1.12.0