|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.luaj.vm2.Varargs
org.luaj.vm2.LuaValue
org.luaj.vm2.LuaThread
public class LuaThread
Implementation of lua coroutines using Java Threads
| Field Summary | |
|---|---|
int |
calls
|
LuaFunction[] |
callstack
|
java.lang.Object |
debugState
|
LuaValue |
err
|
static int |
MAX_CALLSTACK
|
static LuaValue |
s_metatable
|
| Fields inherited from class org.luaj.vm2.LuaValue |
|---|
CALL, EMPTYSTRING, FALSE, INDEX, METATABLE, MINUSONE, MODE, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, ZERO |
| Constructor Summary | |
|---|---|
LuaThread(LuaValue func,
LuaValue env)
|
|
| Method Summary | |
|---|---|
LuaThread |
checkthread()
|
static int |
getCallstackDepth()
|
static LuaFunction |
getCallstackFunction(int level)
Get the function called as a specific location on the stack. |
LuaValue |
getfenv()
|
static LuaValue |
getGlobals()
Get the current thread's environment |
LuaValue |
getmetatable()
|
static LuaThread |
getRunning()
|
java.lang.String |
getStatus()
|
static boolean |
isMainThread(LuaThread r)
|
boolean |
isthread()
|
static void |
onCall(LuaFunction function)
|
static void |
onReturn()
|
LuaThread |
optthread(LuaThread defval)
|
Varargs |
resume(Varargs args)
Start or resume this thread |
void |
run()
|
void |
setfenv(LuaValue env)
|
static void |
setGlobals(LuaValue globals)
Set the globals of the current thread |
int |
type()
|
java.lang.String |
typename()
|
Varargs |
yield(Varargs args)
|
| Methods inherited from class org.luaj.vm2.Varargs |
|---|
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checkString, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, optString, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static LuaValue s_metatable
public LuaValue err
public static final int MAX_CALLSTACK
public final LuaFunction[] callstack
public int calls
public java.lang.Object debugState
| Constructor Detail |
|---|
public LuaThread(LuaValue func,
LuaValue env)
| Method Detail |
|---|
public int type()
type in class LuaValuepublic java.lang.String typename()
typename in class LuaValuepublic boolean isthread()
isthread in class LuaValuepublic LuaThread optthread(LuaThread defval)
optthread in class LuaValuepublic LuaThread checkthread()
checkthread in class LuaValuepublic LuaValue getmetatable()
getmetatable in class LuaValuepublic LuaValue getfenv()
getfenv in class LuaValuepublic void setfenv(LuaValue env)
setfenv in class LuaValuepublic java.lang.String getStatus()
public static LuaThread getRunning()
public static boolean isMainThread(LuaThread r)
public static void setGlobals(LuaValue globals)
public static LuaValue getGlobals()
public static final void onCall(LuaFunction function)
public static final void onReturn()
public static int getCallstackDepth()
public static final LuaFunction getCallstackFunction(int level)
level - 1 for the function calling this one, 2 for the next one.
public void run()
run in interface java.lang.Runnablepublic Varargs yield(Varargs args)
public Varargs resume(Varargs args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||