File coro_raw.h
Declarations for special coroutine operations.
Most of these functions are either used in scheduler development, or in very special cases.
Functions
-
void coro_yield_with_event(CoroEventSource const *event)
Yield a coroutine with the provided signal source.
This yields the coroutine with CORO_SIG_NOTIFY.
Warning
This is a special operation typically used for scheduler or communication primitive development. User application constructs should stick with regular yields.
- Parameters:
event – Event to yield.
-
void coro_yield_with_signal(CoroSignal signal)
Yield a coroutine with the provided signal type.
Warning
This is a low-level yield, the caller is expected to correctly set up the coroutine’s internal state before calling this to ensure correct operation.
- Parameters:
signal – Signal to yield.
-
bool coro_notify(Coro *coro, CoroEventSource const *event)
Notify a coroutine of an event that may affect it’s internal state.
Note
If a coroutine is not blocked, the events are ignored.
Warning
This is a special operation typically used for scheduler or communication primitive development.
- Parameters:
coro – Coroutine to notify.
event – Notification event.
- Returns:
True if the coroutine’s state has changed.
-
CoroSignal coro_resume(Coro *coro)
Resumes the coroutine from the point it last yielded.
Warning
This is a special operation typically used for scheduler or communication primitive development.
- Parameters:
coro – Coroutine to resume.
- Returns:
Signal to the scheduler to action.