Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Added parameters to indicate flow id, so unique flows use a reliable msg_task_send...
[simgrid.git] / tools / sg_unit_extractor.pl
index 4e233f1e17c6a4b566dbe049963b14e0fc9a808f..37b702593e30bc7b59f834b430d4b59d46d15075 100755 (executable)
@@ -1,6 +1,13 @@
 #! /usr/bin/perl
 
 use strict;
+use Fcntl ':flock';
+
+open SELF, "< $0" or die "Cannot open the lock file";
+if (!flock SELF, LOCK_EX | LOCK_NB) {
+    print STDERR "sg_unit_extractor already running. Cancelling...\n";
+    exit;
+}
 
 my $progname="sg_unit_extractor";
 # Get the args