def detachThreadFromJVM(): """ 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. """ _jpype.detachThreadFromJVM()
def detachThreadFromJVM(): _jpype.detachThreadFromJVM()
def detachThreadFromJVM() : _jpype.detachThreadFromJVM()
def testDetachThread(self): self.assertTrue(_jpype.isThreadAttachedToJVM()) _jpype.detachThreadFromJVM() self.assertFalse(_jpype.isThreadAttachedToJVM()) _jpype.attachThreadToJVM()
def testDetachThreadFault(self): _jpype.fault("PyJPModule_detachThread") with self.assertRaisesRegex(SystemError, "fault"): _jpype.detachThreadFromJVM()