Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Allow methods in Lock only on definite objects
they segfault on the type object
  • Loading branch information
moritz committed Dec 21, 2014
1 parent c0dd8ae commit 284c098
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/Lock.pm
Expand Up @@ -15,19 +15,19 @@ my class Lock is repr('ReentrantMutex') {
method signal_all() { nqp::condsignalall(self) }
}

method lock() { nqp::lock(self) }
method lock(Lock:D:) { nqp::lock(self) }

method unlock() { nqp::unlock(self) }
method unlock(Lock:D:) { nqp::unlock(self) }

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

method condition() {
method condition(Lock:D:) {
nqp::getlockcondvar(self, ConditionVariable)
}
}
Expand Down

0 comments on commit 284c098

Please sign in to comment.