diff --git a/emper/Blockable.hpp b/emper/Blockable.hpp index d0bef641b188eeb888e7752fe60651f83167317c..90a51a9332478848636b9fdb1c3d0890cce5cf49 100644 --- a/emper/Blockable.hpp +++ b/emper/Blockable.hpp @@ -22,6 +22,8 @@ class Blockable : public Logger<logSubsystem> { ContextManager& contextManager; + workeraffinity_t* affinity = nullptr; + Blockable(Runtime& runtime) : runtime(runtime), contextManager(runtime.getContextManager()) {} // Older clang-tidy versions show a @@ -47,7 +49,7 @@ class Blockable : public Logger<logSubsystem> { blockedContexts.erase(context); } - return Fiber::from([this, context]() { contextManager.discardAndResume(context); }); + return Fiber::from([this, context]() { contextManager.discardAndResume(context); }, affinity); } template <CallerEnvironment callerEnvironment = CallerEnvironment::EMPER> diff --git a/emper/PrivateSemaphore.hpp b/emper/PrivateSemaphore.hpp index 8c19341d4e772fb46e3d0661b3ce1ce2f273d41c..cc9bf9702733735112609004d5d1ccaf6c15dfab 100644 --- a/emper/PrivateSemaphore.hpp +++ b/emper/PrivateSemaphore.hpp @@ -46,7 +46,10 @@ class PrivateSemaphore : protected Blockable<LogSubsystem::PS> { return nullptr; } - void signalFromAnywhere() { signal<CallerEnvironment::ANYWHERE>(); } + void signalFromAnywhere(workeraffinity_t* affinity = nullptr) { + this->affinity = affinity; + signal<CallerEnvironment::ANYWHERE>(); + } void signalAndExit() { if (Context* readyContext = signalInternal()) { diff --git a/emper/io/Future.cpp b/emper/io/Future.cpp index d374fe24e31a8c5a95a7e3a36313141d631791f3..013997e48ab062918c6ee6572da931c850f92de8 100644 --- a/emper/io/Future.cpp +++ b/emper/io/Future.cpp @@ -11,7 +11,6 @@ #include "BinaryPrivateSemaphore.hpp" // for BPS #include "CallerEnvironment.hpp" // for CallerEnvironment #include "Debug.hpp" // for LOGD, LOGW -#include "Runtime.hpp" // for Runtime #include "io/IoContext.hpp" // for IoContext #include "io/Stats.hpp" // for Stats, Operation