Skip to content

Commit a65a6d8

Browse files
authored
Merge pull request #50 from prina404/master
Allow GIL release during main A* loop
2 parents df656ed + 230ccc7 commit a65a6d8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/cpp/astar.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ static PyObject *astar(PyObject *self, PyObject *args) {
8383
int start_j = start % w;
8484

8585
heuristic_ptr heuristic_func = select_heuristic(heuristic_override);
86-
86+
Py_BEGIN_ALLOW_THREADS
8787
while (!nodes_to_visit.empty()) {
8888
// .top() doesn't actually remove the node
8989
Node cur = nodes_to_visit.top();
@@ -136,6 +136,7 @@ static PyObject *astar(PyObject *self, PyObject *args) {
136136
}
137137
}
138138
}
139+
Py_END_ALLOW_THREADS
139140

140141
PyObject *return_val;
141142
if (path_length >= 0) {

0 commit comments

Comments
 (0)