coroutine wrapper with c