From a666b3a78cf84185647db4e132fe3b39fc5dd0e2 Mon Sep 17 00:00:00 2001 From: Hanbin Lee Date: Wed, 8 Jan 2025 14:38:55 -0500 Subject: [PATCH] add GIL release for statistics --- python/_tskitmodule.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/_tskitmodule.c b/python/_tskitmodule.c index 8663bd8695..65036e2df1 100644 --- a/python/_tskitmodule.c +++ b/python/_tskitmodule.c @@ -9715,9 +9715,11 @@ TreeSequence_weighted_stat_vector_method( if (result_array == NULL) { goto out; } + Py_BEGIN_ALLOW_THREADS err = method(self->tree_sequence, w_shape[1], PyArray_DATA(weights_array), num_windows, PyArray_DATA(windows_array), num_focal_nodes, PyArray_DATA(focal_nodes_array), PyArray_DATA(result_array), options); + Py_END_ALLOW_THREADS if (err != 0) { handle_library_error(err); goto out;