mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-25 21:40:33 +05:00
Fix GIL issue (see previous commit for details)
This commit is contained in:
parent
163135981e
commit
af5e003790
@ -1234,15 +1234,12 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
|
||||
{
|
||||
MeshingParameters mp;
|
||||
if(pars) mp = *pars;
|
||||
{
|
||||
py::gil_scoped_acquire acquire;
|
||||
CreateMPfromKwargs(mp, kwargs);
|
||||
}
|
||||
CreateMPfromKwargs(mp, kwargs);
|
||||
py::gil_scoped_release gil_release;
|
||||
MeshVolume (mp, self);
|
||||
OptimizeVolume (mp, self);
|
||||
}, py::arg("mp")=nullptr,
|
||||
meshingparameter_description.c_str(),
|
||||
py::call_guard<py::gil_scoped_release>())
|
||||
meshingparameter_description.c_str())
|
||||
|
||||
.def ("OptimizeVolumeMesh", [](Mesh & self, MeshingParameters* pars)
|
||||
{
|
||||
|
@ -188,17 +188,16 @@ NGCORE_API_EXPORT void ExportSTL(py::module & m)
|
||||
{
|
||||
MeshingParameters mp;
|
||||
STLParameters stlparam;
|
||||
{ py::gil_scoped_acquire aq;
|
||||
if(pars)
|
||||
{
|
||||
auto mp_flags = pars->geometrySpecificParameters;
|
||||
auto mp_kwargs = CreateDictFromFlags(mp_flags);
|
||||
CreateSTLParametersFromKwargs(stlparam, mp_kwargs);
|
||||
mp = *pars;
|
||||
}
|
||||
CreateSTLParametersFromKwargs(stlparam, kwargs);
|
||||
CreateMPfromKwargs(mp, kwargs); // this will throw if any kwargs are not passed
|
||||
if(pars)
|
||||
{
|
||||
auto mp_flags = pars->geometrySpecificParameters;
|
||||
auto mp_kwargs = CreateDictFromFlags(mp_flags);
|
||||
CreateSTLParametersFromKwargs(stlparam, mp_kwargs);
|
||||
mp = *pars;
|
||||
}
|
||||
CreateSTLParametersFromKwargs(stlparam, kwargs);
|
||||
CreateMPfromKwargs(mp, kwargs); // this will throw if any kwargs are not passed
|
||||
py::gil_scoped_release gil_release;
|
||||
if(!mesh)
|
||||
{
|
||||
mesh = make_shared<Mesh>();
|
||||
@ -215,7 +214,6 @@ NGCORE_API_EXPORT void ExportSTL(py::module & m)
|
||||
|
||||
return mesh;
|
||||
}, py::arg("mp") = nullptr, py::arg("mesh") = nullptr,
|
||||
py::call_guard<py::gil_scoped_release>(),
|
||||
(meshingparameter_description + stlparameter_description).c_str())
|
||||
.def("Draw", FunctionPointer
|
||||
([] (shared_ptr<STLGeometry> self)
|
||||
|
Loading…
Reference in New Issue
Block a user