Skip to content

Commit

Permalink
implement task abstraction
Browse files Browse the repository at this point in the history
  • Loading branch information
daronenko committed Sep 16, 2024
1 parent fd390de commit 0295f53
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions source/fiber/sched/task/task.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#pragma once

#include <wheels/intrusive/forward_list.hpp>

namespace fiber::sched::task {

struct ITask {
virtual void Run() noexcept = 0;

protected:
~ITask() = default;
};

// Intrusive task
struct TaskBase : ITask,
wheels::IntrusiveForwardListNode<TaskBase> {};

} // namespace fiber::sched::task

0 comments on commit 0295f53

Please sign in to comment.