Skip to content

Commit

Permalink
use name :)
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.coderepos.org/share/lang/perl/App-MadEye/trunk@14627 d0d07461-0603-4401-acd4-de1884942a52
  • Loading branch information
tokuhirom committed Jun 26, 2008
1 parent f075bdf commit 7739ea6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/App/MadEye/Plugin/Check/Flock.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ use strict;
use warnings;
use base qw/App::MadEye::Plugin::Base/;
use LWP::UserAgent;
use Fcntl ":flock";

sub check : Hook('check') {
my ($self, $context, $args) = @_;

my $file_name = $self->config->{config}->{file} or die "missing file";
open $self->{lock_fh} , '>' , $file_name or die $!;
my $status = flock( $self->{lock_fh}, 6 ) or die "cannot get the lock";
my $status = flock( $self->{lock_fh}, LOCK_EX|LOCK_NB ) or die "cannot get the lock";
}

sub release_lock : Hook('after_run_jobs') {
Expand Down

0 comments on commit 7739ea6

Please sign in to comment.