lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

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

...? 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
|    | Earthlike planets other than our own *do* look like
| ( | Welsh quarries?" --- Coyu, on rasfw, while
+- --+ discussing _Blakes 7_