Fix
This commit is contained in:
parent
da0bcfbb63
commit
6cdb8b0ffd
1 changed files with 7 additions and 10 deletions
|
@ -2,7 +2,6 @@
|
||||||
#include <cserver/engine/basic/task_processor.hpp>
|
#include <cserver/engine/basic/task_processor.hpp>
|
||||||
#include <cserver/engine/coroutine.hpp>
|
#include <cserver/engine/coroutine.hpp>
|
||||||
#include <utempl/utils.hpp>
|
#include <utempl/utils.hpp>
|
||||||
#include <thread>
|
|
||||||
|
|
||||||
namespace cserver {
|
namespace cserver {
|
||||||
|
|
||||||
|
@ -73,14 +72,12 @@ inline constexpr auto GetInitFlagFor(auto&... args) -> InitFlag& {
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename InitFlag, utempl::Tuple Tuple>
|
template <typename InitFlag, utempl::Tuple Tuple>
|
||||||
inline constexpr auto TransformDependencyGraphToInited(auto&&... args) {
|
constexpr auto TransformDependencyGraphToTupleWithDependenciesToInitedFlagChanges(auto&&... args) {
|
||||||
return [&]<std::size_t... Is>(std::index_sequence<Is...>) {
|
return utempl::Map(utempl::PackConstexprWrapper<Tuple>(), [&]<auto Array>(utempl::Wrapper<Array>) {
|
||||||
return utempl::Tuple{[&]<auto Array>(utempl::Wrapper<Array>){
|
return utempl::Map(utempl::PackConstexprWrapper<Array, utempl::Tuple<>>(), [&](auto elem) {
|
||||||
return [&]<std::size_t... IIs>(std::index_sequence<IIs...>){
|
return &GetInitFlagFor<InitFlag, static_cast<std::size_t>(elem)>(args...);
|
||||||
return std::array<InitFlag*, Array.size()>{&GetInitFlagFor<InitFlag, Array[IIs]>(args...)...};
|
}, utempl::kType<std::array<InitFlag*, Array.size()>>);
|
||||||
}(std::make_index_sequence<Array.size()>());
|
});
|
||||||
}(utempl::Wrapper<Get<Is>(Tuple)>{})...};
|
|
||||||
}(std::make_index_sequence<utempl::kTupleSize<decltype(Tuple)>>());
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct AsyncConditionVariable {
|
struct AsyncConditionVariable {
|
||||||
|
@ -124,7 +121,7 @@ inline constexpr auto InitComponents(T& ccontext) -> void {
|
||||||
static auto& context = ccontext;
|
static auto& context = ccontext;
|
||||||
static auto& taskProcessor = context.template FindComponent<kBasicTaskProcessorName>();
|
static auto& taskProcessor = context.template FindComponent<kBasicTaskProcessorName>();
|
||||||
static auto& ioContext = taskProcessor.ioContext;
|
static auto& ioContext = taskProcessor.ioContext;
|
||||||
static utempl::Tuple inited = TransformDependencyGraphToInited<AsyncConditionVariable, DependencyGraph>(ioContext);
|
static utempl::Tuple inited = TransformDependencyGraphToTupleWithDependenciesToInitedFlagChanges<AsyncConditionVariable, DependencyGraph>(ioContext);
|
||||||
auto work = make_work_guard(ioContext);
|
auto work = make_work_guard(ioContext);
|
||||||
[]<std::size_t... Is>(std::index_sequence<Is...>){
|
[]<std::size_t... Is>(std::index_sequence<Is...>){
|
||||||
(boost::asio::co_spawn(ioContext, []() -> cserver::Task<> {
|
(boost::asio::co_spawn(ioContext, []() -> cserver::Task<> {
|
||||||
|
|
Loading…
Reference in a new issue