# OrphanedThread (Luaj API)
Date: 2015-04-29

## org.luaj.vm2
Class OrphanedThread

    java.lang.Object
      java.lang.Throwable
          java.lang.Error
              org.luaj.vm2.OrphanedThread

All Implemented Interfaces:
  java.io.Serializable

    public class OrphanedThread

extends java.lang.Error

`Error` sublcass that indicates a lua thread that is no longer referenced has been detected.

The java thread in which this is thrown should correspond to a `LuaThread` being used as a coroutine that could not possibly be resumed again because there are no more references to the LuaThread with which it is associated. Rather than locking up resources forever, this error is thrown, and should fall through all the way to the thread's `Thread.run()` method.

Java code mixed with the luaj vm should not catch this error because it may occur when the coroutine is not running, so any processing done during error handling could break the thread-safety of the application because other lua processing could be going on in a different thread.

See Also:
  Serialized Form

Constructor Summary
`OrphanedThread()`

Method Summary

Methods inherited from class java.lang.Throwable
`fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### OrphanedThread

    public OrphanedThread()

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