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.

28 lines
473 B

  1. package Thread::Specific;
  2. =head1 NAME
  3. Thread::Specific - thread-specific keys
  4. =head1 SYNOPSIS
  5. use Thread::Specific;
  6. my $k = key_create Thread::Specific;
  7. =head1 DESCRIPTION
  8. C<key_create> returns a unique thread-specific key.
  9. =cut
  10. sub import : locked : method {
  11. require fields;
  12. fields::->import(@_);
  13. }
  14. sub key_create : locked : method {
  15. our %FIELDS; # suppress "used only once"
  16. return ++$FIELDS{__MAX__};
  17. }
  18. 1;