https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23571

--- Comment #12 from Jonathan Druart <[email protected]> 
---
Also, do you know that you can lock a portion of the file?

I have no idea why your code is that complicated, I think you should
investigate this code:

use Modern::Perl;
use Fcntl qw(:flock);
sub is_locked {
    unless ( flock(DATA, LOCK_EX|LOCK_NB) ) {
        return 1;
    }    
    return 0;
}

die "is locked" if is_locked();

say "is not locked! sleeping 5 sec";
sleep(5);

__DATA__
USED BY LOCK - DO NOT REMOVE

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to