Re: How to create another lua_State in pthread?

  • From: Hiroaki Nakamura <hnakamur@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Sat, 26 Jan 2013 00:28:01 +0900

Hi, Mike.

Thank you for your patch.
Now it works!

2013/1/25 Mike Pall <mike-1301@xxxxxxxxxx>:
> Hiroaki Nakamura wrote:
>> Now I am trying to get the callback function defined in another Lua state
>> and call pthread_create with the callback address.
>
> You must cast the Lua function ('hello') to a C function pointer
> and then to a number in the other state and then convert it back
> to a function pointer in the main state.
>
> Patch attached.
>
> --Mike



-- 
中村 弘輝 )Hiroaki Nakamura) hnakamur@xxxxxxxxx

Other related posts: