MCPcopy Create free account
hub / github.com/FastLED/FastLED / CoroutineRuntimeStub

Class CoroutineRuntimeStub

src/platforms/stub/coroutine_stub.h:122–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120//=============================================================================
121
122class CoroutineRuntimeStub : public ICoroutineRuntime {
123public:
124 void pumpCoroutines(fl::u32 us) FL_NOEXCEPT override {
125 fl::detail::CoroutineRunner::instance().run(us);
126 }
127
128 void suspendMainthread(fl::u32 us) FL_NOEXCEPT override {
129 // Stub coroutines are std::threads — calling CoroutineRunner::run()
130 // from a worker thread would deadlock on the two-phase semaphore handoff.
131 // Instead, just sleep for the requested duration (safe from any thread).
132 fl::this_thread::sleep_for(fl::chrono::microseconds(us)); // ok sleep for
133 }
134};
135
136//=============================================================================
137// Task Coroutine — std::thread-based

Callers

nothing calls this directly

Calls 2

sleep_forFunction · 0.70
runMethod · 0.45

Tested by

no test coverage detected