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
14using namespace std::chrono_literals;
15
16namespace 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
bool is_work_done(const std::future< T > &task) noexcept
Check if an async thread has finished or not.
Definition Async.hpp:31
Timer.hpp galaxy.
Definition Async.hpp:17