recode lua-threads