File: //lib/fm-agent/dependencies/linux/python3.9/jpype/__pycache__/_jthread.cpython-39.pyc
a
��iG � @ s2 d dl Z ddlmZ e�d�G dd� de��ZdS )� N� )�_jcustomizerzjava.lang.Threadc @ s@ e Zd ZdZedd� �Zedd� �Zedd� �Zedd � �Zd
S )�_JThreadzz Customizer for ``java.land.Thread``
This adds addition JPype methods to java.lang.Thread to support
Python.
c C s t �� S )a
Checks if a thread is attached to the JVM.
Python automatically attaches as daemon threads when a Java method is
called. This creates a resource in Java for the Python thread. This
method can be used to check if a Python thread is currently attached so
that it can be disconnected prior to thread termination to prevent
leaks.
Returns:
True if the thread is attached to the JVM, False if the thread is
not attached or the JVM is not running.
)�_jpype�isThreadAttachedToJVM� r r �@/usr/lib/fm-agent/dependencies/linux/python3.9/jpype/_jthread.py�
isAttached s z_JThread.isAttachedc C s t �� S )an Attaches the current thread to the JVM as a user thread.
User threads that are attached to the JVM will prevent the JVM from
shutting down until the thread is terminated or detached. To convert
a daemon thread to a main thread, the thread must first be detached.
Raises:
RuntimeError: If the JVM is not running.
)r �attachThreadToJVMr r r r �attach. s z_JThread.attachc C s t �� S )a� Attaches the current thread to the JVM as a daemon.
Daemon threads act as background tasks and do not prevent the JVM from
shutdown normally. JPype automatically attaches any threads that call
Java resources as daemon threads. To convert a daemon thread to a user
thread, the thread must first be detached.
Raises:
RuntimeError: If the JVM is not running.
)r �attachThreadAsDaemonr r r r �attachAsDaemon; s z_JThread.attachAsDaemonc C s t �� S )a� Detaches a thread from the JVM.
This function detaches the thread and frees the associated resource in
the JVM. For codes making heavy use of threading this should be used
to prevent resource leaks. The thread can be reattached, so there
is no harm in detaching early or more than once. This method cannot fail
and there is no harm in calling it when the JVM is not running.
)r �detachThreadFromJVMr r r r �detachI s
z_JThread.detachN) �__name__�
__module__�__qualname__�__doc__�staticmethodr r r
r r r r r r s
r )r � r �JImplementationFor�objectr r r r r �<module> s