public synchronized Varargs lua_resume(LuaThread new_thread, Varargs args) {
			LuaThread previous_thread = globals.running;
			try {
				globals.running = new_thread;
				this.args = args;
				if (this.status == STATUS_INITIAL) {
					this.status = STATUS_RUNNING;
					new Thread(this, "Coroutine-" + (++coroutine_count)).start();
				} else {
					this.notify();
				}
				if (previous_thread != null)
					previous_thread.state.status = STATUS_NORMAL;
				this.status = STATUS_RUNNING;
				this.wait();
				return (this.error != null ? LuaValue.varargsOf(LuaValue.FALSE, LuaValue.valueOf(this.error)) : LuaValue.varargsOf(LuaValue.TRUE, this.result));
			} catch (InterruptedException ie) {
				throw new OrphanedThread();
			} finally {
				this.args = LuaValue.NONE;
				this.result = LuaValue.NONE;
				this.error = null;
				globals.running = previous_thread;
				if (previous_thread != null)
					globals.running.state.status = STATUS_RUNNING;
			}
		}