Skip to content

Commit

Permalink
No need for intermediary now we have LEAVE
Browse files Browse the repository at this point in the history
Also, we don't need a block for LEAVE either.
  • Loading branch information
lizmat committed Nov 1, 2016
1 parent b5780f0 commit b623210
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/core/Lock.pm
Expand Up @@ -20,9 +20,8 @@ my class Lock {

method protect(Lock:D: &code) {
nqp::lock(self);
my \res := code();
LEAVE { nqp::unlock(self); }
res
LEAVE nqp::unlock(self);
code()
}

method condition(Lock:D:) {
Expand Down

0 comments on commit b623210

Please sign in to comment.