]> git.proxmox.com Git - pve-common.git/commit - src/PVE/Tools.pm
Implement refcounting for flocks
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Wed, 10 Feb 2016 07:25:23 +0000 (08:25 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 10 Feb 2016 10:12:12 +0000 (11:12 +0100)
commitf127adaba550ef1fd5ccdbff258efdfc5f48a096
tree13558eeb84aa8131881cecee4dd5b7e05783b8c8
parent881eb755318100c4587a3cb48cc5aa41f05f1a6d
Implement refcounting for flocks

This was already implemented in PVE::LXC::lock_aquire() and
lock_release(). Enabling refcounting in the general
PVE::Tools::lock_file() and lock_file_full() methods allows
us to use one code base for flocking.

Furthermore, we could get rid of various xx_no_lock methods
that were required because the old non-refcounting version
did not support nested flocks (the inner most flock would
close the file handle and thus release the flock).
src/PVE/Tools.pm