lua-users home
lua-l archive

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

Actually never mind, I think I have it working. I passed the wrong
number of arguments to newthread and it crashed my app. I guess it
doesn't use a pcall...

Should I protect the Lua functions in Delphi in some way or are things
ready to go without changes?

- Ron

> I am using Lua in a delphi Application and have been doing so for
> quite some time, recently we decided to look into multi threading. We
> are have successfully compiled the LuaThread library and the demo

> local function flood(output, word)
>     while 1 do 
>         output:lock()
>         io.write(word, ", ")
>         output:unlock()
>     end
> end

> local output = thread.newmutex()
> thread.newthread(flood, {output, "child"})
> flood(output, "parent")

> works sometimes in my implementation, when I call certain functions
> defined in the Delphi app things go bad. The function itself is
> threadsafe except for the Lua handling code...

> I assume that something needs to be changed, looking at the source of
> LuaThreads I cannot figure out what I have to do, can someone point
> me in the right direction. Feel free to post C code I can translate it.

> Thanks!!

> - Ron