diff options
Diffstat (limited to 't/lib/AtomicMethod/Role')
-rw-r--r-- | t/lib/AtomicMethod/Role/Method.pm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/t/lib/AtomicMethod/Role/Method.pm b/t/lib/AtomicMethod/Role/Method.pm new file mode 100644 index 0000000..e11f506 --- /dev/null +++ b/t/lib/AtomicMethod/Role/Method.pm @@ -0,0 +1,15 @@ +package AtomicMethod::Role::Method; +use Moose::Role; + +around wrap => sub { + my ($orig, $self, $body, @args) = @_; + my $new_body = sub { + warn "locking...\n"; + my @ret = $body->(@_); # XXX: context + warn "unlocking...\n"; + return @ret; + }; + $self->$orig($new_body, @args); +}; + +1; |