Skip Menu |

This queue is for tickets about the Proc-PID-File CPAN distribution.

Report information
The Basics
Id: 4189
Status: resolved
Priority: 0/
Queue: Proc-PID-File

People
Owner: Nobody in particular
Requestors: bcant [...] centra-systems.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 1.3
Fixed in: 1.3



Subject: wishlist: non-blocking flock()
Proc-PID-File-1.3 perl 5.8.0 Redhat GNU/Linux 9 I was having problems with ->alive() when fork()ing which was my problem. The symptom however was the script blocking during Proc::PID::File->read() at flock(). With the attached patch a die() is called instead if the file is already locked.
45,46c45 < flock(FH, LOCK_EX | LOCK_NB) < || die "pid ".$self->{'path'}." already locked"; --- > flock FH, LOCK_EX; 59,60c58 < flock(FH, LOCK_EX | LOCK_NB) < || die "pid ".$self->{'path'}." already locked"; --- > flock FH, LOCK_EX;
thanks so much for the patch. I don't visit RT that often so I just now incorporated it into the code. check out 1.23 con CPAN!