| 393 | } |
| 394 | |
| 395 | void ICoroutineTask::exitCurrent() FL_NOEXCEPT { |
| 396 | auto* ctx = runningStubCoroutineContext(); |
| 397 | if (ctx) { |
| 398 | ctx->set_completed(true); |
| 399 | // Signal "done" to unblock the main thread's second acquire() |
| 400 | fl::detail::CoroutineRunner::instance().get_main_thread_semaphore().release(); |
| 401 | } |
| 402 | // Block forever — thread will be joined during cleanup |
| 403 | while (true) { |
| 404 | fl::this_thread::sleep_for(fl::chrono::seconds(1)); // ok sleep for |
| 405 | } |
| 406 | } |
| 407 | |
| 408 | } // namespace platforms |
| 409 | } // namespace fl |