Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
5c1d1022
Unverified
Commit
5c1d1022
authored
Mar 12, 2021
by
Peter Eastman
Committed by
GitHub
Mar 12, 2021
Browse files
Release GIL when calling getState() (#3061)
parent
c9c27264
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
wrappers/python/src/swig_doxygen/swig_lib/python/exceptions.i
...pers/python/src/swig_doxygen/swig_lib/python/exceptions.i
+14
-0
No files found.
wrappers/python/src/swig_doxygen/swig_lib/python/exceptions.i
View file @
5c1d1022
...
@@ -10,6 +10,20 @@
...
@@ -10,6 +10,20 @@
}
}
}
}
%
exception
*::
getState
{
PyThreadState
*
_savePythonThreadState
=
PyEval_SaveThread
()
;
try
{
$
action
}
catch
(
std
::
exception
&
e)
{
PyEval_RestoreThread
(
_savePythonThreadState
)
;
PyObject
*
mm
=
PyImport_AddModule
(
"openmm"
)
;
PyObject
*
openmm_exception
=
PyObject_GetAttrString
(
mm
,
"OpenMMException"
)
;
PyErr_SetString
(
openmm_exception
,
const_cast
<
char
*>
(
e
.
what
()))
;
return
NULL
;
}
PyEval_RestoreThread
(
_savePythonThreadState
)
;
}
%
exception
*::
step
{
%
exception
*::
step
{
PyThreadState
*
_savePythonThreadState
=
PyEval_SaveThread
()
;
PyThreadState
*
_savePythonThreadState
=
PyEval_SaveThread
()
;
try
{
try
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment