| 61 | //============================================================================= |
| 62 | |
| 63 | void CoroutineContext::entry_trampoline() FL_NOEXCEPT { |
| 64 | CoroutineContext* self = globals().current; |
| 65 | if (self && self->mFunction) { |
| 66 | self->mFunction(); |
| 67 | } |
| 68 | |
| 69 | // Mark completed and switch back to runner |
| 70 | if (self) { |
| 71 | self->mCompleted = true; |
| 72 | } |
| 73 | |
| 74 | void* runner = get_runner_ctx(); |
| 75 | if (runner && self) { |
| 76 | ICoroutinePlatform::instance().contextSwitch( |
| 77 | self->mPlatformCtx, runner); |
| 78 | } |
| 79 | |
| 80 | // Should never reach here |
| 81 | while (true) {} |
| 82 | } |
| 83 | |
| 84 | CoroutineContext* CoroutineContext::create(fl::function<void()> func, |
| 85 | size_t stack_size) FL_NOEXCEPT { |
nothing calls this directly
no test coverage detected