| 105 | } |
| 106 | |
| 107 | void operator()() |
| 108 | { |
| 109 | SKR_ASSERT(*this); |
| 110 | if (func) |
| 111 | { |
| 112 | func(); |
| 113 | func = {}; |
| 114 | } |
| 115 | else |
| 116 | { |
| 117 | #ifdef SKR_PROFILE_ENABLE |
| 118 | // the first fiber enter is in coroutine body |
| 119 | if(coro.promise().name != nullptr) |
| 120 | SkrFiberEnter(coro.promise().name); |
| 121 | #endif |
| 122 | SKR_ASSERT(!coro.done()); |
| 123 | coro.resume(); |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | explicit operator bool() const |
| 128 | { |