sub test {
use attrs qw(locked method);
...
}
@a = attrs::get(\test);
You should use a form like the following instead:
sub test : locked method { }
You can read more about attributes in the next
section.
The valid attributes are:
- locked
-
Meaningful only when the subroutine or method will be called by
multiple threads. When set on a subroutine that also has the method
attribute set, invoking that subroutine implicitly locks its first
argument before execution. On a non-method subroutine, a lock is
taken on the subroutine itself before execution. The lock semantics
are identical to one taken explicitly with the
lock operator immediately after entering the
subroutine.
- method
-
The invoking subroutine is a method.
| | |
8.3. attributes | | 8.5. AutoLoader |