Skip to content

Commit 451ebe3

Browse files
Before disaster
1 parent a77dbbb commit 451ebe3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

parse.pl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use re 'eval';
44
use threads;
55
use threads::shared;
6-
use Clone 'clone';
6+
#use Clone 'clone';
77

88
my @threads;
99
my $donework :shared;
@@ -578,11 +578,12 @@ sub getidtostor {
578578
#CORE::print ("$ident " . Dumper2(\@{$identstoidmap->{$ident}}) . "\n");
579579

580580
foreach my $id (@{$identstoidmap->{$ident}}) {
581-
CORE::print ($id->[0] . " against " . $currpos . "\n");
581+
#CORE::print ($id->[0] . " against " . $currpos . "\n");
582582
last if ($id->[0] > $currpos);
583583
$lastid++;
584584
}
585585
}
586+
#CORE::print ("lastid $lastid\n");
586587
return $lastid;
587588
}
588589

@@ -597,6 +598,8 @@ sub broadcastid {
597598

598599
CORE::print ("signalling over " . $idtosignal . "\n");
599600

601+
lock @{$identstoidmap->{$ident}->[$idtosignal]};
602+
600603
$identstoidmap->{$ident}->[$idtosignal]->[1] = 1;
601604

602605
cond_broadcast(@{$identstoidmap->{$ident}})
@@ -633,6 +636,7 @@ sub waitforid {
633636
#CORE::print("$currpos waitin : " . Dumper2(\@{$identstoidmap->{$ident}}));
634637

635638
foreach my $ind (@{$identstoidmap->{$ident}}) {
639+
lock @{$ind};
636640
#CORE::print ("check map $ind \n");
637641
last if(not ($ind->[0] <= $currpos));
638642
$areallset = $areallset && $ind->[1];

0 commit comments

Comments
 (0)