Commit a1c0f183 authored by peastman's avatar peastman
Browse files

Fixed compilation errors on some platforms

parent 44c8ea9c
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
int enforcePeriodic, int enforcePeriodic,
int groups) { int groups) {
State state; State state;
Py_BEGIN_ALLOW_THREADS PyThreadState* _savePythonThreadState = PyEval_SaveThread();
int types = 0; int types = 0;
if (getPositions) types |= State::Positions; if (getPositions) types |= State::Positions;
if (getVelocities) types |= State::Velocities; if (getVelocities) types |= State::Velocities;
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
state = self->getState(types, enforcePeriodic, groups); state = self->getState(types, enforcePeriodic, groups);
} }
catch (...) { catch (...) {
Py_END_ALLOW_THREADS PyEval_RestoreThread(_savePythonThreadState);
throw; throw;
} }
Py_END_ALLOW_THREADS PyEval_RestoreThread(_savePythonThreadState);
return _convertStateToLists(state); return _convertStateToLists(state);
} }
...@@ -156,7 +156,7 @@ Parameters: ...@@ -156,7 +156,7 @@ Parameters:
int enforcePeriodic, int enforcePeriodic,
int groups) { int groups) {
State state; State state;
Py_BEGIN_ALLOW_THREADS PyThreadState* _savePythonThreadState = PyEval_SaveThread();
int types = 0; int types = 0;
if (getPositions) types |= State::Positions; if (getPositions) types |= State::Positions;
if (getVelocities) types |= State::Velocities; if (getVelocities) types |= State::Velocities;
...@@ -167,10 +167,10 @@ Parameters: ...@@ -167,10 +167,10 @@ Parameters:
state = self->getState(copy, types, enforcePeriodic, groups); state = self->getState(copy, types, enforcePeriodic, groups);
} }
catch (...) { catch (...) {
Py_END_ALLOW_THREADS PyEval_RestoreThread(_savePythonThreadState);
throw; throw;
} }
Py_END_ALLOW_THREADS PyEval_RestoreThread(_savePythonThreadState);
return _convertStateToLists(state); return _convertStateToLists(state);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment