[Bio] / FigKernelPackages / JobScheduler.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/JobScheduler.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1, Mon Dec 6 18:31:40 2004 UTC revision 1.2, Fri Dec 17 23:20:56 2004 UTC
# Line 34  Line 34 
34    
35  package JobScheduler;  package JobScheduler;
36    
37    use Carp;
38  use FIG;  use FIG;
39  use FIG_Config;  use FIG_Config;
40  use FileHandle;  use FileHandle;
# Line 54  Line 55 
55    
56      $dir = "$FIG_Config::data/JobQueue" unless $dir;      $dir = "$FIG_Config::data/JobQueue" unless $dir;
57    
58        warn "Scheduler using $dir\n";
59      &FIG::verify_dir($dir);      &FIG::verify_dir($dir);
60    
61      my $self = {      my $self = {
# Line 109  Line 111 
111    
112    
113      my @jobs = $self->get_job_list();      my @jobs = $self->get_job_list();
114      warn "Candidate jobs: @jobs\n";      # warn "Candidate jobs: @jobs\n";
115    
116      #      #
117      # Run through the jobs in order.      # Run through the jobs in order.
# Line 194  Line 196 
196      # Ensure we hold the $dir/sched.lock lockfile before reading or modifying NextJob.      # Ensure we hold the $dir/sched.lock lockfile before reading or modifying NextJob.
197      #      #
198    
199      my $lock = lock_scheduler();      my $lock = $self->lock_scheduler();
200    
201      my $job_fh;      my $job_fh;
202      my $job_file = "$self->{dir}/NextJob";      my $job_file = "$self->{dir}/NextJob";
# Line 277  Line 279 
279    
280      my $fh = new FileHandle;      my $fh = new FileHandle;
281    
282      sysopen($fh, $file, O_RDWR | O_CREAT) or die "Cannot open lockfile $file: $!\n";      sysopen($fh, $file, O_RDWR | O_CREAT) or confess "Cannot open lockfile $file: $!\n";
283    
284      flock($fh, LOCK_EX) or die "Cannot flock $file: $!\n";      flock($fh, LOCK_EX) or die "Cannot flock $file: $!\n";
285    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3