コード例 #1
0
ファイル: _core.py プロジェクト: cc2841319251/learn_git
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()
コード例 #2
0
ファイル: _core.py プロジェクト: JiadaoZ22/NLP
def detachThreadFromJVM():
    _jpype.detachThreadFromJVM()
コード例 #3
0
ファイル: _core.py プロジェクト: Kcrong/speech_analysis
def detachThreadFromJVM() :
    _jpype.detachThreadFromJVM()
コード例 #4
0
 def testDetachThread(self):
     self.assertTrue(_jpype.isThreadAttachedToJVM())
     _jpype.detachThreadFromJVM()
     self.assertFalse(_jpype.isThreadAttachedToJVM())
     _jpype.attachThreadToJVM()
コード例 #5
0
 def testDetachThreadFault(self):
     _jpype.fault("PyJPModule_detachThread")
     with self.assertRaisesRegex(SystemError, "fault"):
         _jpype.detachThreadFromJVM()