MCPcopy Create free account
hub / github.com/covscript/covscript / yield

Function yield

sources/system/unix/common.cpp:430–437  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

428 }
429
430 void yield()
431 {
432 if (current_process->fiber_stack.empty())
433 throw lang_error("Cannot yield outside a fiber.");
434 unix_fiber *fi = static_cast<unix_fiber *>(current_process->fiber_stack.top().get());
435 fi->state = fiber_state::suspended;
436 cs_fiber_swapcontext(&fi->ctx, fi->prev_ctx);
437 }
438 } // namespace fiber
439
440 namespace dll {

Callers 1

await_implFunction · 0.50

Calls 3

lang_errorClass · 0.85
emptyMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected