> I had another thought... With lua_pushthread all works well: weak-keys automatic collected. And errcodes of threads stored in registry.errid[thread]. I hope, lua_pushthread will be added to standart Lua distr.