forked from lix-project/lix
* Doh! The scope of $slotLock should extend to the end of the script,
because otherwise the lock will be released at the end of the while loop.
This commit is contained in:
parent
c9b2d80bcd
commit
7ec5a65925
|
@ -94,6 +94,7 @@ sub openSlotLock {
|
||||||
|
|
||||||
|
|
||||||
my $hostName;
|
my $hostName;
|
||||||
|
my $slotLock;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
|
||||||
|
@ -164,7 +165,7 @@ while (1) {
|
||||||
my $selected = $available[0];
|
my $selected = $available[0];
|
||||||
my $machine = $selected->{machine};
|
my $machine = $selected->{machine};
|
||||||
|
|
||||||
my $slotLock = openSlotLock($machine, $selected->{free});
|
$slotLock = openSlotLock($machine, $selected->{free});
|
||||||
flock($slotLock, LOCK_EX | LOCK_NB) or die;
|
flock($slotLock, LOCK_EX | LOCK_NB) or die;
|
||||||
utime undef, undef, $slotLock;
|
utime undef, undef, $slotLock;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue