Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.5 KiB

  1. package attrs;
  2. use XSLoader ();
  3. $VERSION = "1.0";
  4. =head1 NAME
  5. attrs - set/get attributes of a subroutine (deprecated)
  6. =head1 SYNOPSIS
  7. sub foo {
  8. use attrs qw(locked method);
  9. ...
  10. }
  11. @a = attrs::get(\&foo);
  12. =head1 DESCRIPTION
  13. NOTE: Use of this pragma is deprecated. Use the syntax
  14. sub foo : locked method { }
  15. to declare attributes instead. See also L<attributes>.
  16. This pragma lets you set and get attributes for subroutines.
  17. Setting attributes takes place at compile time; trying to set
  18. invalid attribute names causes a compile-time error. Calling
  19. C<attrs::get> on a subroutine reference or name returns its list
  20. of attribute names. Notice that C<attrs::get> is not exported.
  21. Valid attributes are as follows.
  22. =over
  23. =item method
  24. Indicates that the invoking subroutine is a method.
  25. =item locked
  26. Setting this attribute is only meaningful when the subroutine or
  27. method is to be called by multiple threads. When set on a method
  28. subroutine (i.e. one marked with the B<method> attribute above),
  29. perl ensures that any invocation of it implicitly locks its first
  30. argument before execution. When set on a non-method subroutine,
  31. perl ensures that a lock is taken on the subroutine itself before
  32. execution. The semantics of the lock are exactly those of one
  33. explicitly taken with the C<lock> operator immediately after the
  34. subroutine is entered.
  35. =back
  36. =cut
  37. XSLoader::load 'attrs', $VERSION;
  38. 1;