| 307 | } |
| 308 | |
| 309 | void yield() |
| 310 | { |
| 311 | if (current_process->fiber_stack.empty()) |
| 312 | throw lang_error("Cannot yield outside a fiber."); |
| 313 | win32_fiber *fi = static_cast<win32_fiber *>(current_process->fiber_stack.top().get()); |
| 314 | fi->state = fiber_state::suspended; |
| 315 | SwitchToFiber(fi->prev_ctx); |
| 316 | } |
| 317 | } // namespace fiber |
| 318 | |
| 319 | namespace dll { |
nothing calls this directly
no test coverage detected