On Jul 7, 2006, at 3:10 AM, Peter Hull wrote:
> Quick question - is it possible to pause/resume the whole of Io, i.e.
> a function that is called from C, runs every active coro until it has
> yielded, then returns to C? I don't really understand the docs/code on
> this issue.
Hi Peter,
Yes. When you're in C, you can get a reference to the current
coroutine by calling:
IoCoroutine *currentCoro = IoState_currentCoroutine(ioState);
If you have a pointer to an IoCoroutine you'd like to resume, you can
call:
IoCoroutine_rawResume(someCoro);
To resume it. To resume the initial coroutine, you can call:
IoCoroutine_rawResume(currentCoro);
Or call resume on it on the Io side.
- Steve