Skip to content
Snippets Groups Projects
Commit 9568f3a4 authored by Florian Schmaus's avatar Florian Schmaus
Browse files

Add Fiber::print()

parent c6a0e7f3
Branches
Tags
No related merge requests found
......@@ -13,7 +13,19 @@ void Fiber::run() const {
std::ostream& operator<<(std::ostream& strm, const Fiber& fiber) {
strm << "Fiber [ptr=" << &fiber
<< " func=" << fiber.function.target<void(void*)>()
<< " arg=" << fiber.arg
<< "]";
<< " arg=" << fiber.arg;
if (fiber.affinity) {
strm << " aff=" << fiber.affinity;
} else {
strm << " aff=nullptr";
}
strm << "]";
return strm;
}
void Fiber::print() const {
std::cout << this << std::endl;
}
......@@ -127,6 +127,8 @@ public:
return *affinity;
}
void print() const;
friend std::ostream& operator<<(std::ostream&, const Fiber&);
static inline Fiber* from(fiber_fun_t function, void* arg) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment