diff options
author | Jesse Luehrs <doy@tozt.net> | 2010-07-19 19:21:54 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2010-07-19 19:21:54 -0500 |
commit | d1bab5d4a5ea4100803c871461c62744767c514b (patch) | |
tree | 1e596286d921bdd58e2bc61eef5aff1c91a70e1b /t/lib/AtomicMethod/Role/Method.pm | |
parent | 636f22f307ff0dc94a2c2ec23d49c872ecddbc02 (diff) | |
download | moosex-exporter-easy-d1bab5d4a5ea4100803c871461c62744767c514b.tar.gz moosex-exporter-easy-d1bab5d4a5ea4100803c871461c62744767c514b.zip |
Diffstat (limited to 't/lib/AtomicMethod/Role/Method.pm')
-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; |