[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: PATCH: true C coroutines -- yield across C stack from anywhere
- From: David Given <dg@...>
- Date: Fri, 22 Oct 2004 13:53:26 +0100
On Friday 22 October 2004 13:40, Jean-Christophe Capdevila wrote:
[...]
> What i want to do is that when the C function WaitEvent is called, it
> yields the coroutine..
> That is working perfectly, but i want the coroutine to restart at the
> function WaitEvent and not the line after ( index = index + 1 )...
> In this way, each time i call a resume on the coroutine, the same C
> function is called and decide if coroutine must yield and stay at it, or
> continue it's execution..
Could you just do:
while WaitEvent() do
end
...? So your C function returns true if it wants WaitEvent to be called again,
and false if it wants execution to continue?
--
+- David Given --McQ-+ "I've just had a terrible thought --- what if all
| dg@cowlark.com | Earthlike planets other than our own *do* look like
| (dg@tao-group.com) | Welsh quarries?" --- Coyu, on rasfw, while
+- www.cowlark.com --+ discussing _Blakes 7_