Navigation Menu

Skip to content

Commit

Permalink
Fix a missing pre-comp store unlock.
Browse files Browse the repository at this point in the history
This could cause the store to remain locked until program exit. This
was particularly problematic on Windows parallel spectests, causing a
hang. The test harness seems to read from the processes one at a time
on Windows, blocking the output of those it's not currently reading
from. A test that needed to pre-compile something while running would
block on acquiring the lock, which was being held by another script that
would not release it until process exit. In combination, this created a
circular wait, and thus a deadlock. However, there are probably platform
independent deadlocks that could have been caused by this bug, not to
mention inefficiency.
  • Loading branch information
jnthn committed Apr 8, 2016
1 parent 81e6747 commit a93edd9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/core/CompUnit/PrecompilationRepository.pm
Expand Up @@ -89,7 +89,13 @@ class CompUnit::PrecompilationRepository::Default does CompUnit::PrecompilationR
if $path {
my $modified = $path.modified;
if (not $since or $modified > $since) and self!load-dependencies($path, $modified) {
%!loaded{$id} //= self!load-handle-for-path($path)
with %!loaded{$id} {
self.store.unlock;
$_
}
else {
%!loaded{$id} = self!load-handle-for-path($path)
}
}
else {
if $*RAKUDO_MODULE_DEBUG -> $RMD {
Expand Down

0 comments on commit a93edd9

Please sign in to comment.