lua-users home
lua-l archive

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


Hello,

I have the following problem : when coroutine.yield is called from the
script side in the thread, which is created from the C side using
lua_newthread, an error

"attempt to yield across metamethod/C-call boundary"

occured. If I change to lua_newcthread, all is ok.

But all is ok only in case when newly created thread is in the lua
stack, though I use luaL_ref for referencing thread to prevent it to
be garbage collected and to remove it form the lua stack. This scheme
works fine for Lua 5.1 alpha, but it doesn work with LuaJIT + Coco.

This behaviour doesn't depend on the feature
LUAJIT_MODE_ON/LUAJIT_MODE_OFF

What am I doing wrong? Does LuaJIT depends on luaopen_... sequence?
Our sequence is the following :

lua_newstate
luaopen_base
luaopen_table
luaopen_string
luaopen_math
luaopen_debug
luaopen_jit
luaJIT_setmode
luaopen_coco

-- 
Best regards,
 Dmitriy                            mailto:iassenev@gsc-game.kiev.ua