diff --git a/src/vault/gear/scheduler-commutator.hpp b/src/vault/gear/scheduler-commutator.hpp index 69d2c44df..28bd0a836 100644 --- a/src/vault/gear/scheduler-commutator.hpp +++ b/src/vault/gear/scheduler-commutator.hpp @@ -145,44 +145,17 @@ namespace gear { Activity* findWork (SchedulerInvocation& layer1, Time now) { - layer1.feedPrioritisation(); - UNIMPLEMENTED("wtf??"); - while (layer1.isDue (currentSchedulerTime())) + if (holdsGroomingToken(std::this_thread::get_id()) + or acquireGoomingToken()) { - Activity* activity = layer1.pullHead(); - if (isInternalWork (activity)) - performInternalWork (activity); - else - { - performExternalWork (activity); - UNIMPLEMENTED("return"); - } + layer1.feedPrioritisation(); + if (layer1.isDue (now)) + return layer1.pullHead(); } + return nullptr; } - Time - currentSchedulerTime() const - { - UNIMPLEMENTED ("how to manage the current scheduler time"); - } - bool - isInternalWork (Activity* activity) - { - UNIMPLEMENTED ("determine if an Activity counts as internal management task"); - } - - void - performInternalWork (Activity* activity) - { - UNIMPLEMENTED ("evaluate a term"); - } - - void - performExternalWork (Activity* activity) - { - UNIMPLEMENTED ("drop the exclusion flag and then engage into the external render activity"); - } template activity::Proc diff --git a/tests/vault/gear/scheduler-commutator-test.cpp b/tests/vault/gear/scheduler-commutator-test.cpp index d06174099..8bff31bbe 100644 --- a/tests/vault/gear/scheduler-commutator-test.cpp +++ b/tests/vault/gear/scheduler-commutator-test.cpp @@ -53,6 +53,8 @@ namespace test { using lib::time::Time; using std::atomic_bool; using lib::ThreadHookable; + using lib::thread::ThreadWrapper; + using std::unique_ptr; using std::make_unique; using std::this_thread::yield; @@ -202,7 +204,11 @@ namespace test { while (not stopTheHog_); sched.dropGroomingToken(); }} - .atExit([&]{ groomingHog_.reset(); }) + .atExit([&](ThreadWrapper& handle) + { + handle.detach_thread_from_wrapper(); + groomingHog_.reset(); + }) .threadID("grooming-hog")); sleep_for (500us); } @@ -218,8 +224,8 @@ namespace test { - /** @test TODO verify the decision logic where and when - * to perform the dispatch of an Scheduler Activity chain. + /** @test verify the decision logic where and when to perform + * the dispatch of an Scheduler Activity chain. * @todo WIP 10/23 ✔ define ⟶ ✔ implement */ void @@ -267,8 +273,8 @@ namespace test { - /** @test TODO verify logic of queue updates and work prioritisation. - * @todo WIP 10/23 🔁 define ⟶ implement + /** @test verify logic of queue updates and work prioritisation. + * @todo WIP 10/23 ✔ define ⟶ ✔ implement */ void verify_findWork() diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 637956633..d1f94dac2 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -85018,10 +85018,10 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- + - + @@ -85037,6 +85037,22 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
+ + + + + + + + +

+ man könnte es hier auch freigeben; das würde dann aber im Regelfall ein weiteres mal geprüft und freigegeben; zudem haben wir hier auf dieser Ebene auch kein try-catch +

+ +
+ +
+
@@ -85081,14 +85097,14 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- - - + + + - + - + @@ -86262,8 +86278,8 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- - + + @@ -86275,6 +86291,9 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
+ + +