simple thread manager for Lua