File.pm6 (rakudo-2020.09) | : | File.pm6 (rakudo-2020.10) | ||
---|---|---|---|---|
skipping to change at line 121 | skipping to change at line 121 | |||
--> Bool:D) { | --> Bool:D) { | |||
my $result := self.CompUnit::PrecompilationUnit::is-up-to-date($depe ndency, :$check-source); | my $result := self.CompUnit::PrecompilationUnit::is-up-to-date($depe ndency, :$check-source); | |||
$!store.remove-from-cache($.id) unless $result; | $!store.remove-from-cache($.id) unless $result; | |||
$result | $result | |||
} | } | |||
} | } | |||
has IO::Path:D $.prefix is built(:bind) is required; | has IO::Path:D $.prefix is built(:bind) is required; | |||
has IO::Handle $!lock; | has IO::Handle $!lock; | |||
#?if moar | ||||
has atomicint $!lock-count; | ||||
#?endif | ||||
#?if !moar | ||||
has int $!lock-count; | has int $!lock-count; | |||
#?endif | ||||
has $!loaded; | has $!loaded; | |||
has $!dir-cache; | has $!dir-cache; | |||
has $!compiler-cache; | has $!compiler-cache; | |||
has Lock $!update-lock; | has Lock $!update-lock; | |||
submethod TWEAK(--> Nil) { | submethod TWEAK(--> Nil) { | |||
$!update-lock := Lock.new; | $!update-lock := Lock.new; | |||
$!loaded := nqp::hash; | $!loaded := nqp::hash; | |||
$!dir-cache := nqp::hash; | $!dir-cache := nqp::hash; | |||
$!compiler-cache := nqp::hash; | $!compiler-cache := nqp::hash; | |||
skipping to change at line 171 | skipping to change at line 176 | |||
CompUnit::PrecompilationId:D $precomp-id, | CompUnit::PrecompilationId:D $precomp-id, | |||
Str:D :$extension = '' | Str:D :$extension = '' | |||
) { | ) { | |||
self!dir($compiler-id, $precomp-id).add($precomp-id ~ $extension) | self!dir($compiler-id, $precomp-id).add($precomp-id ~ $extension) | |||
} | } | |||
method !lock($path --> Nil) { | method !lock($path --> Nil) { | |||
$!update-lock.lock; | $!update-lock.lock; | |||
$!lock := "$path.lock".IO.open(:create, :rw) | $!lock := "$path.lock".IO.open(:create, :rw) | |||
unless $!lock; | unless $!lock; | |||
#?if moar | ||||
$!lock-count⚛++; | ||||
$!lock.lock if ⚛$!lock-count == 1; | ||||
#?endif | ||||
#?if !moar | ||||
$!lock.lock if $!lock-count++ == 0; | $!lock.lock if $!lock-count++ == 0; | |||
#?endif | ||||
} | } | |||
method unlock() { | method unlock() { | |||
LEAVE $!update-lock.unlock; | LEAVE $!update-lock.unlock; | |||
#?if moar | ||||
die "unlock when we're not locked!" if ⚛$!lock-count == 0; | ||||
$!lock-count⚛-- if ⚛$!lock-count > 0; | ||||
if $!lock && ⚛$!lock-count == 0 { | ||||
#?endif | ||||
#?if !moar | ||||
die "unlock when we're not locked!" if $!lock-count == 0; | die "unlock when we're not locked!" if $!lock-count == 0; | |||
$!lock-count-- if $!lock-count > 0; | $!lock-count-- if $!lock-count > 0; | |||
if $!lock && $!lock-count == 0 { | if $!lock && $!lock-count == 0 { | |||
#?endif | ||||
$!lock.unlock; | $!lock.unlock; | |||
$!lock.close; | $!lock.close; | |||
$!lock := IO::Handle; | $!lock := IO::Handle; | |||
} | } | |||
True | True | |||
} | } | |||
method load-unit( | method load-unit( | |||
CompUnit::PrecompilationId:D $compiler-id, | CompUnit::PrecompilationId:D $compiler-id, | |||
CompUnit::PrecompilationId:D $precomp-id | CompUnit::PrecompilationId:D $precomp-id | |||
End of changes. 6 change blocks. | ||||
0 lines changed or deleted | 19 lines changed or added |