Skip to content
Snippets Groups Projects

AST-945 Protect embedded python code by mutex

Merged Bas van der Tol requested to merge ast-945-protect-embedded-python-code-by-mutex into main
1 file
+ 5
0
Compare changes
  • Side-by-side
  • Inline
@@ -9,6 +9,8 @@
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include <mutex>
namespace radler::algorithms {
struct PyChannel {
@@ -197,6 +199,9 @@ float PythonDeconvolution::ExecuteMajorIteration(
size_t nFreq = dirty_set.NDeconvolutionChannels();
size_t nPol = dirty_set.Size() / dirty_set.NDeconvolutionChannels();
static std::mutex mutex;
const std::lock_guard<std::mutex> lock(mutex);
pybind11::object result;
// A new context block is started to destroy the python data arrays asap
Loading