Skip to content
Snippets Groups Projects

[LAWS/Fiber] Introduce the concept of Multi-Fiber

Merged Florian Schmaus requested to merge flow/emper:laws-opti into master
Files
3
@@ -4,6 +4,7 @@
#include "Common.hpp" // for DIE_MSG
#include "Emper.hpp"
#include "Fiber.hpp"
#include "LawsStrategy.hpp" // for LawsStrategy, LawsStrategy::FiberSource
#include "NextFiberResult.hpp"
#include "Runtime.hpp"
@@ -12,8 +13,10 @@
void LawsDispatcher::recycle(Fiber* fiber) {
// If the ref count has not reached zero yet, do not recycle the
// fiber.
if (decreaseRefCount(fiber)) return;
// fiber. But only if the fiber is a multi fiber, i.e. was placed
// in multiple queues in the first place, and hence needed to be
// refcounted.
if (fiber->isMultiFiber() && decreaseRefCount(fiber)) return;
Dispatcher::recycle(fiber);
}
Loading