Subject: | The internal tracking of attributes is not ithreads-safe |
The API of MODIFY_CODE_ATTRIBUTES is based on coderefs (akin to that of Type::Tiny). As such there needs to be a CLONE guard which re-numbers the entire registry of "known refs". Minimal failcase attached.
perl -e '
use threads;
use Data::Dumper;
use Moose;
use MooseX::MethodAttributes;
sub foo :Bar :Baz { rand() };
my $report = sub { warn Dumper __PACKAGE__->meta->get_method("foo")->attributes };
threads->new( $report )->join;
$report->()
'