XML::SAX::ExpatXS thread protection

This commit is contained in:
fbsanchez 2019-08-07 13:18:44 +02:00
parent b07be3885d
commit d902afc7db

View File

@ -195,11 +195,11 @@ sub data_consumer ($$) {
eval { eval {
threads->yield; threads->yield;
# XML::SAX::ExpatXS is not thread safe. # XML::SAX::ExpatXS is not thread safe.
if ($XML::Simple::PREFERRED_PARSER == 'XML::SAX::ExpatXS') { if ($XML::Simple::PREFERRED_PARSER eq 'XML::SAX::ExpatXS') {
$XMLinSem->down(); $XMLinSem->down();
} }
$xml_data = XMLin ($file_name, forcearray => 'module'); $xml_data = XMLin ($file_name, forcearray => 'module');
if ($XML::Simple::PREFERRED_PARSER == 'XML::SAX::ExpatXS') { if ($XML::Simple::PREFERRED_PARSER eq 'XML::SAX::ExpatXS') {
$XMLinSem->up(); $XMLinSem->up();
} }
}; };