}
}
- return;
+ return 1;
}
my $wiz_name = spawn_wiz VMG_OP_INFO_NAME;
$destroyed = 0;
}
+ my $completed = 0;
+
my @threads = map spawn(\&try, $dispell, $wiz), 1 .. 2;
- $_->join for @threads;
+ for my $thr (@threads) {
+ my $res = $thr->join;
+ $completed += $res if defined $res;
+ }
{
lock $c;
- is $c, 2, "get triggered twice";
+ is $c, $completed, "get triggered twice";
}
{
lock $destroyed;
- is $destroyed, (1 - $dispell) * 2, 'destructors';
+ is $destroyed, (1 - $dispell) * $completed, 'destructors';
}
}
}