org.python.core.ThreadStateMapping Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jython-slim Show documentation
Show all versions of jython-slim Show documentation
Jython is an implementation of the high-level, dynamic, object-oriented
language Python written in 100% Pure Java, and seamlessly integrated with
the Java platform. It thus allows you to run Python on any Java platform.
package org.python.core;
import com.google.common.collect.MapMaker;
import java.util.Map;
/**
* A ThreadState augments a standard java.lang.Thread to support Python semantics. The ThreadStateMapping utility class
* ensures that the runtime can look up a ThreadState at any time for a given Thread, while also ensuring that it is
* properly cleaned up.
*
* A ThreadState to Thread relation must be maintained over the entirety of the Python call stack, including any
* interleaving with Java code. This relationship is maintained by inCallThreadState; the use of ThreadLocal