public LuaValue call(LuaValue env) { globals = env.checkglobals(); LuaTable coroutine = new LuaTable(); coroutine.set("create", new create()); coroutine.set("resume", new resume()); coroutine.set("running", new running()); coroutine.set("status", new status()); coroutine.set("yield", new yield()); coroutine.set("wrap", new wrap()); env.set("coroutine", coroutine); env.get("package").get("loaded").set("coroutine", coroutine); return coroutine; }
public LuaValue call(LuaValue f) { return new LuaThread(globals, f.checkfunction()); }
public LuaValue call(LuaValue f) { final LuaValue func = f.checkfunction(); final LuaThread thread = new LuaThread(globals, func); return new wrapper(thread); }
public LuaValue call(LuaValue t) { LuaThread lt = t.checkthread(); return valueOf(lt.getStatus()); }