org.luaj.vm
Class LThread

java.lang.Object
  extended by org.luaj.vm.LValue
      extended by org.luaj.vm.LThread
All Implemented Interfaces:
java.lang.Runnable

public class LThread
extends LValue
implements java.lang.Runnable

Implementation of lua coroutines using Java Threads


Field Summary
 LuaState vm
           
 
Fields inherited from class org.luaj.vm.LValue
TM_INDEX, TM_METATABLE, TM_MODE, TM_NEWINDEX
 
Constructor Summary
LThread(LFunction c, LTable env)
           
 
Method Summary
static LThread getRunning()
           
 java.lang.String getStatus()
           
 int luaGetType()
          Valid for all types: return the int value identifying the type of this value
 boolean luaSetEnv(LTable t)
          Set the environment if a thread, or closure, and return true, otherwise return false
 void resumeFrom(LuaState vm, int nargs)
           
 void run()
           
 java.lang.String toJavaString()
          Convert to a Java String
 void yield()
           
 
Methods inherited from class org.luaj.vm.LValue
compareError, conversionError, id, isClosure, isFunction, isInteger, isNil, isNumber, isString, isTable, isUserData, isValidKey, luaAsString, luaBinCmpDouble, luaBinCmpInteger, luaBinCmpString, luaBinCmpUnknown, luaBinOpDouble, luaBinOpInteger, luaBinOpUnknown, luaConcatTo, luaGetEnv, luaGetMetatable, luaGetTable, luaGetTypeName, luaLength, luaSetMetatable, luaSetTable, luaStackCall, luaToNumber, luaUnaryMinus, toJavaBoolean, toJavaBoxedBoolean, toJavaBoxedByte, toJavaBoxedCharacter, toJavaBoxedDouble, toJavaBoxedFloat, toJavaBoxedInteger, toJavaBoxedLong, toJavaBoxedShort, toJavaByte, toJavaChar, toJavaDouble, toJavaFloat, toJavaInstance, toJavaInt, toJavaLong, toJavaShort, toString, toStrongReference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

vm

public final LuaState vm
Constructor Detail

LThread

public LThread(LFunction c,
               LTable env)
Method Detail

luaGetType

public int luaGetType()
Description copied from class: LValue
Valid for all types: return the int value identifying the type of this value

Specified by:
luaGetType in class LValue

toJavaString

public java.lang.String toJavaString()
Description copied from class: LValue
Convert to a Java String

Overrides:
toJavaString in class LValue

luaSetEnv

public boolean luaSetEnv(LTable t)
Description copied from class: LValue
Set the environment if a thread, or closure, and return true, otherwise return false

Overrides:
luaSetEnv in class LValue

getStatus

public java.lang.String getStatus()

getRunning

public static LThread getRunning()

run

public void run()
Specified by:
run in interface java.lang.Runnable

yield

public void yield()

resumeFrom

public void resumeFrom(LuaState vm,
                       int nargs)


Copyright © 2007-2013 Luaj.org. All Rights Reserved.