lua-users home
lua-l archive

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


On Friday 10 March 2006 9:20 pm, Vijay Aswadhati wrote:
> I have C++ tasks (that I wish I could make them invocable from Lua)
> that can be canceled or it's state updated from one or more tasks.

i have renamed the helper.finish(task) function to helper.update(task) and 
added the C function signal_task(). the idea is that it's now useful as a 
general communication between Lua code and a working thread.

from the worker thread, when you want to send something to Lua, you call 
signal_task(), passing a boolean true if you want the thread to be paused.  
this causes the task to appear in the output queue.  the Lua code then should 
call update(task, ...) to get any intermediate data, or even to send some 
data to the thread.  thread will be automatically unpaused, if appropriate.

please check it in CVS.

-- 
Javier

Attachment: pgp0L2_FzhgsR.pgp
Description: PGP signature