Resync with mainline prior to post-5.6.0 updates
[p5sagit/p5-mst-13.2.git] / ext / Thread / Thread / Specific.pm
1 package Thread::Specific;
2
3 =head1 NAME
4
5 Thread::Specific - thread-specific keys
6
7 =head1 SYNOPSIS
8
9     use Thread::Specific;
10     my $k = key_create Thread::Specific;
11
12 =head1 DESCRIPTION
13
14 C<key_create> returns a unique thread-specific key.
15
16 =cut
17
18 sub import : locked : method {
19     require fields;
20     fields::->import(@_);
21 }       
22
23 sub key_create : locked : method {
24     our %FIELDS;   # suppress "used only once"
25     return ++$FIELDS{__MAX__};
26 }
27
28 1;