XML::SAX::ExpatXS thread protection

This commit is contained in:
fbsanchez 2019-08-07 13:18:44 +02:00
parent b07be3885d
commit d902afc7db
1 changed files with 2 additions and 2 deletions

View File

@ -195,11 +195,11 @@ sub data_consumer ($$) {
eval {
threads->yield;
# 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();
}
$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();
}
};