devdaily home | apple | java | perl | unix | directory | blog

What this is

This file is included in the DevDaily.com "Perl Source Code Warehouse" project. The intent of this project is to help you "Learn Perl by Example" TM.

Other links

The source code

package Thread::Specific;

our $VERSION = '1.00';

=head1 NAME

Thread::Specific - thread-specific keys

=head1 SYNOPSIS

    use Thread::Specific;
    my $k = key_create Thread::Specific;

=head1 DESCRIPTION

C returns a unique thread-specific key.

=cut

sub import : locked : method {
    require fields;
    fields::->import(@_);
}	

sub key_create : locked : method {
    our %FIELDS;   # suppress "used only once"
    return ++$FIELDS{__MAX__};
}

1;




Copyright 1998-2008 Alvin Alexander
All Rights Reserved.
 
devdaily.com is based in louisville, kentucky, and this web site is hosted by godaddy.com