Skip to content

Commit

Permalink
Move Metamodel::C3MRO to use ::Locking
Browse files Browse the repository at this point in the history
And added ::Locking role to classes that now need it
  • Loading branch information
lizmat committed Mar 18, 2024
1 parent 68628fe commit cf46bd5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
7 changes: 1 addition & 6 deletions src/Perl6/Metamodel/C3MRO.nqp
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
role Perl6::Metamodel::C3MRO {
# Storage of the MRO.
has $!mro;
has $!mro_lock;

method TWEAK(*%named) {
$!mro_lock := NQPLock.new();
}

# Computes C3 MRO.
method compute_mro($class) {
Expand Down Expand Up @@ -139,7 +134,7 @@ role Perl6::Metamodel::C3MRO {
++$i;
}

$!mro_lock.protect({
self.protect({
$!mro := nqp::hash(
'all', nqp::hash(
'all', @all,
Expand Down
1 change: 1 addition & 0 deletions src/Perl6/Metamodel/ConcreteRoleHOW.nqp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class Perl6::Metamodel::ConcreteRoleHOW
does Perl6::Metamodel::Locking
does Perl6::Metamodel::Naming
does Perl6::Metamodel::BUILDALL
does Perl6::Metamodel::Composing
Expand Down
1 change: 1 addition & 0 deletions src/Perl6/Metamodel/NativeHOW.nqp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class Perl6::Metamodel::NativeHOW
does Perl6::Metamodel::Locking
does Perl6::Metamodel::Naming
does Perl6::Metamodel::BUILDALL
does Perl6::Metamodel::Documenting
Expand Down
1 change: 1 addition & 0 deletions src/Perl6/Metamodel/NativeRefHOW.nqp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#- Metamodel::NativeRefHOW -----------------------------------------------------
class Perl6::Metamodel::NativeRefHOW
does Perl6::Metamodel::Locking
does Perl6::Metamodel::Naming
does Perl6::Metamodel::BUILDALL
does Perl6::Metamodel::Documenting
Expand Down

0 comments on commit cf46bd5

Please sign in to comment.