diff --git a/source/mijin/async/coroutine.hpp b/source/mijin/async/coroutine.hpp index 2711113..3111b01 100644 --- a/source/mijin/async/coroutine.hpp +++ b/source/mijin/async/coroutine.hpp @@ -191,10 +191,10 @@ struct TaskReturn }; } -template typename TAllocator = MIJIN_DEFAULT_ALLOCATOR> +template typename TAllocator = MIJIN_DEFAULT_ALLOCATOR> using TaskFuture = Future; -template typename TAllocator = MIJIN_DEFAULT_ALLOCATOR> +template typename TAllocator = MIJIN_DEFAULT_ALLOCATOR> using TaskFuturePtr = FuturePtr; template typename TAllocator> @@ -964,7 +964,7 @@ template } template typename TAllocator> -inline std::suspend_always switchContext(TaskLoop& taskLoop) +inline std::suspend_always c_switchContext(TaskLoop& taskLoop) { TaskLoop& currentTaskLoop = TaskLoop::current(); if (¤tTaskLoop == &taskLoop) { @@ -974,6 +974,12 @@ inline std::suspend_always switchContext(TaskLoop& taskLoop) return {}; } +template typename TAllocator> +inline std::suspend_always switchContext(TaskLoop& taskLoop) +{ + return c_switchContext(taskLoop); +} + template typename TAllocator> void BaseSimpleTaskLoop::transferCurrentTask(TaskLoop& otherLoop) MIJIN_NOEXCEPT { @@ -1229,7 +1235,7 @@ void BaseMultiThreadedTaskLoop::workerThread(std::stop_token stopTok // run it getCurrentTask() = &*task; impl::gCurrentTaskState = task->task->sharedState(); - tickTask(*task); + base_t::tickTask(*task); getCurrentTask() = nullptr; impl::gCurrentTaskState = nullptr;