File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed
Tool/Sources/PythonHelper Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -33,12 +33,12 @@ public func initializePython<GilState, ThreadState>(
3333 isPythonInitialized = true
3434 // Initialize python
3535 Py_Initialize ( )
36- // Immediately release the thread, so that we can ensure the GIL state later.
37- // We may not recover the thread because all future tasks will be done in the other threads.
38- _ = PyEval_SaveThread ( )
39- // Setup GIL state guard.
40- gilStateEnsure = { PyGILState_Ensure ( ) }
41- gilStateRelease = { gilState in PyGILState_Release ( gilState as! GilState ) }
36+ // // Immediately release the thread, so that we can ensure the GIL state later.
37+ // // We may not recover the thread because all future tasks will be done in the other threads.
38+ // _ = PyEval_SaveThread()
39+ // // Setup GIL state guard.
40+ // gilStateEnsure = { PyGILState_Ensure() }
41+ // gilStateRelease = { gilState in PyGILState_Release(gilState as! GilState) }
4242}
4343
4444public func runPython< T> (
@@ -47,14 +47,14 @@ public func runPython<T>(
4747) throws -> T {
4848 if usePythonThread {
4949 return try PythonThread . shared. runPythonAndWait {
50- return try gilStateGuard {
51- try closure ( )
52- }
50+ // return try gilStateGuard {
51+ return try closure ( )
52+ // }
5353 }
5454 } else {
55- return try gilStateGuard {
56- try closure ( )
57- }
55+ // return try gilStateGuard {
56+ return try closure ( )
57+ // }
5858 }
5959}
6060
You can’t perform that action at this time.
0 commit comments