mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-11 06:18:09 +00:00
#4452 release gil in ifcopenshell.open() and read()
This commit is contained in:
@@ -582,14 +582,20 @@ static IfcUtil::ArgumentType helper_fn_attribute_type(const IfcUtil::IfcBaseClas
|
|||||||
|
|
||||||
%inline %{
|
%inline %{
|
||||||
IfcParse::IfcFile* open(const std::string& fn) {
|
IfcParse::IfcFile* open(const std::string& fn) {
|
||||||
IfcParse::IfcFile* f = new IfcParse::IfcFile(fn);
|
IfcParse::IfcFile* f;
|
||||||
|
Py_BEGIN_ALLOW_THREADS;
|
||||||
|
f = new IfcParse::IfcFile(fn);
|
||||||
|
Py_END_ALLOW_THREADS;
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
IfcParse::IfcFile* read(const std::string& data) {
|
IfcParse::IfcFile* read(const std::string& data) {
|
||||||
char* copiedData = new char[data.length()];
|
char* copiedData = new char[data.length()];
|
||||||
memcpy(copiedData, data.c_str(), data.length());
|
memcpy(copiedData, data.c_str(), data.length());
|
||||||
IfcParse::IfcFile* f = new IfcParse::IfcFile((void *)copiedData, data.length());
|
IfcParse::IfcFile* f;
|
||||||
|
Py_BEGIN_ALLOW_THREADS;
|
||||||
|
f = new IfcParse::IfcFile((void *)copiedData, data.length());
|
||||||
|
Py_END_ALLOW_THREADS;
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user