- if (lock_file ($filename)) {
- my $xml = new XML::DOM::Parser -> parsefile ($filename);
- violent_unlock_file ($filename) unless (unlock_file ($filename));
+ my $admin = new Lock ($filename);
+ if ($admin -> lock(LH_SHARED)) {
+ my $xml = new XML::DOM::Parser -> parsefile ($admin -> filename);
+ $admin -> unlock;