Skip to content

cf_coroutine_currently_running

Category: coroutine
GitHub: cute_coroutine.h


Returns the opaque pointer to the coroutine currently running.

CF_Coroutine cf_coroutine_currently_running(void);

Remarks

Each coroutine has ther co pointer handed to them as the only parameter in CF_CoroutineFn, so you likely already have access to the coroutine pointer. However, this function is made available here for convenience. For example, your coroutines may call into other functions -- instead of passing around a co pointer everywhere, your helper functions can simply fetch the CF_Coroutine pointer themselves on an as-needed basis by calling this function.

CF_Coroutine
CF_CoroutineFn
CF_CoroutineState
cf_make_coroutine
cf_destroy_coroutine
cf_coroutine_state_to_string
cf_coroutine_resume
cf_coroutine_yield
cf_coroutine_state
cf_coroutine_get_udata
cf_coroutine_push
cf_coroutine_pop
cf_coroutine_bytes_pushed
cf_coroutine_space_remaining