summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-11-13 18:01:27 +0000
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-11-13 18:01:27 +0000
commit458fb5819c1ac395635ee1129f0f694cb0128ffd (patch)
tree123f1ed4ff91c494e3a36366f37f2cf0fbb87c06 /lib
parentc09156bb55f832ab6700e99026187942841f0ae4 (diff)
downloadperl-458fb5819c1ac395635ee1129f0f694cb0128ffd.tar.gz
Rewrite thread return code to distinguish between ordinary return
and die() and make join propagate the die. Add tiny method eval which just does "return eval { shift->join; }". Add Thread::Specific class for access to thread specific user data along with specific.t. Rename Class to classname throughout Thread.xs for consistency. Fix pp_specific to pp_threadsv in global.sym. Add support to pp_entersub in pp_hot.c to lock stash for static locked methods. p4raw-id: //depot/perl@248
Diffstat (limited to 'lib')
-rw-r--r--lib/fields.pm18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/fields.pm b/lib/fields.pm
new file mode 100644
index 0000000000..8e2d6398bb
--- /dev/null
+++ b/lib/fields.pm
@@ -0,0 +1,18 @@
+package fields;
+
+sub import {
+ my $class = shift;
+ my ($package) = caller;
+ my $fields = \%{"$package\::FIELDS"};
+ my $i = $fields->{__MAX__};
+ foreach my $f (@_) {
+ if (defined($fields->{$f})) {
+ require Carp;
+ Carp::croak("Field name $f already in use");
+ }
+ $fields->{$f} = ++$i;
+ }
+ $fields->{__MAX__} = $i;
+}
+
+1;