Skip to content
Snippets Groups Projects
Commit 9727dd81 authored by Ezekiel Dohmen's avatar Ezekiel Dohmen
Browse files

Incorporating Erik's IPC file locking in feCodeGen

parent 3e6b867c
No related branches found
No related tags found
2 merge requests!439RCG 5.0 release fro deb 10,!367Build Reorganization Total
package CDS::IPCmonitor;
use Exporter;
use Fcntl qw(:flock);
use File::Path;
@ISA = ('Exporter');
......@@ -239,8 +240,11 @@ my @ipcxMaxNum = (-999,-999,-999,-999);
open(TOUCH, ">>$iFile");
close(TOUCH);
}
open(IPCIN, "<$iFile") || die "***ERROR: IPCx parameter file $iFile not found\n";
flock(IPCIN, LOCK_SH) || die "***ERROR: IPCx parameter file $iFile not locked: $!\n";
chomp(@inData=<IPCIN>);
flock(IPCIN, LOCK_UN) || die "***ERROR: IPCx parameter file $iFile not unlocked: $!\n";
close IPCIN;
#
......
......@@ -2,6 +2,7 @@ package CDS::IPCx;
use File::Path qw( make_path );
use Exporter;
use File::Path;
use Fcntl qw(:flock);
@ISA = ('Exporter');
#// \page IPCx IPCx.pm
......@@ -344,8 +345,11 @@ if ($::ipcxCnt > 0) {
open(TOUCH, ">>$iFile");
close(TOUCH);
}
open(IPCIN, "<$iFile") || die "***ERROR: IPCx parameter file $iFile not found\n";
flock(IPCIN, LOCK_SH) || die "***ERROR: Failed to lock file $iFIle: $!\n";
chomp(@inData=<IPCIN>);
flock(IPCIN, LOCK_UN) || die "***ERROR: Failed to unlock file $iFIle: $!\n";
close IPCIN;
#
......@@ -586,7 +590,9 @@ $ipcxRcvrCnt = 0;
# Check if there are any IPCx modules to add to the IPCx parts matrix
#
if ($ipcxNotFound > 0) {
open (IPCOUT, ">>$iFile") || die "***ERROR: Could not open IPCx parameter file $iFile for output\n";
flock (IPCOUT, LOCK_EX) || die "***ERROR: Failed to lock IPCx parameter file $iFile for output: $!\n";
$ipcxRate = 983040/$::rate;
$ipcxNew = 0;
......@@ -664,6 +670,7 @@ $ipcxRcvrCnt = 0;
}
}
flock (IPCOUT, LOCK_UN) || die "***ERROR: Failed to unlock IPCx parameter file $iFile for output: $!\n";
close IPCOUT;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment