diff --git a/emper/Fiber.cpp b/emper/Fiber.cpp index 479b26275c980b92641c4991ee19b4052aaffa36..c6e578ca07a57e391e86e6dccf96be08537dac0c 100644 --- a/emper/Fiber.cpp +++ b/emper/Fiber.cpp @@ -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; +} diff --git a/emper/Fiber.hpp b/emper/Fiber.hpp index 6d2de832d3bc686947dc1a396bf9a56e613e1f6e..4a88f185c3a7b70c8ab70e1dba8d44e32b9bd994 100644 --- a/emper/Fiber.hpp +++ b/emper/Fiber.hpp @@ -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) {