Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix bad assumption about methods being closures.
They're not, since they're looked up via a table in the meta-object.
Thus this could cause data races when paths were being manipulated
from different threads.
  • Loading branch information
jnthn committed Aug 14, 2017
1 parent 29e41b4 commit 231cb3f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/core/IO/Path.pm
Expand Up @@ -24,13 +24,13 @@ my class IO::Path is Cool does IO {
}

method !new-from-absolute-path($path, :$SPEC = $*SPEC, Str() :$CWD = $*CWD) {
method !set-absolute() {
$!is-absolute = True;
$!abspath := $path;
self;
}
self.bless(:$path, :$SPEC, :$CWD)!set-absolute($path);
}

self.bless(:$path, :$SPEC, :$CWD)!set-absolute;
method !set-absolute($path) {
$!is-absolute = True;
$!abspath := $path;
self;
}

proto method new(|) {*}
Expand Down

0 comments on commit 231cb3f

Please sign in to comment.