ext/Thread/README.threads Notes about multithreading
ext/threads/Changes ithreads
ext/Thread/Semaphore.pmx Threadsafe semaphore
-ext/threads/hints/linux.pl thread shared variables
+ext/threads/hints/hpux.pl Hint file for HPUX
+ext/threads/hints/linux.pl Hint file for Linux
ext/threads/Makefile.PL ithreads
ext/Thread/specific.tx Test thread-specific user data
ext/threads/README ithreads
Revision history for Perl extension threads.
+1.32 Mon Jun 5 09:27:53 EDT 2006
+ - Fix for HP-UX 10.20 pthread_attr_getstacksize usage
+ - Check for threads::shared in tests
+
1.31 Fri May 19 16:06:42 EDT 2006
- Explicit thread context
-threads version 1.31
+threads version 1.32
====================
This module needs perl 5.8.0 or later compiled with 'useithreads'.
--- /dev/null
+# HP-UX 10.20 has different form for pthread_attr_getstacksize
+my $ver = `uname -r`;
+$ver =~ s/^\D*//;
+if ($ver =~ /^10.20/) {
+ if (exists($self->{'DEFINE'})) {
+ $self->{'DEFINE'} .= " -DHPUX1020";
+ } else {
+ $self->{'DEFINE'} = "-DHPUX1020";
+ }
+}
use ExtUtils::testlib;
use threads;
-use threads::shared;
-my $TEST;
BEGIN {
+ eval {
+ require threads::shared;
+ import threads::shared;
+ };
+ if ($@ || ! $threads::shared::threads_shared) {
+ print("1..0 # Skip: threads::shared not available\n");
+ exit(0);
+ }
+
$| = 1;
print("1..5\n"); ### Number of tests that will be run ###
-
- share($TEST);
- $TEST = 1;
};
+my $TEST = 1;
+share($TEST);
+
ok(1, 'Loaded');
sub ok {
use ExtUtils::testlib;
use threads;
-use threads::shared;
BEGIN {
+ eval {
+ require threads::shared;
+ import threads::shared;
+ };
+ if ($@ || ! $threads::shared::threads_shared) {
+ print("1..0 # Skip: threads::shared not available\n");
+ exit(0);
+ }
+
$| = 1;
print("1..13\n"); ### Number of tests that will be run ###
};
use ExtUtils::testlib;
use threads;
-use threads::shared;
BEGIN {
+ eval {
+ require threads::shared;
+ import threads::shared;
+ };
+ if ($@ || ! $threads::shared::threads_shared) {
+ print("1..0 # Skip: threads::shared not available\n");
+ exit(0);
+ }
+
$| = 1;
print("1..6\n"); ### Number of tests that will be run ###
};
use ExtUtils::testlib;
use threads;
-use threads::shared;
BEGIN {
+ eval {
+ require threads::shared;
+ import threads::shared;
+ };
+ if ($@ || ! $threads::shared::threads_shared) {
+ print("1..0 # Skip: threads::shared not available\n");
+ exit(0);
+ }
+
$| = 1;
print("1..29\n"); ### Number of tests that will be run ###
};
use ExtUtils::testlib;
use threads;
-use threads::shared;
BEGIN {
+ eval {
+ require threads::shared;
+ import threads::shared;
+ };
+ if ($@ || ! $threads::shared::threads_shared) {
+ print("1..0 # Skip: threads::shared not available\n");
+ exit(0);
+ }
+
if (($] < 5.008002) && ($threads::shared::VERSION < 0.92)) {
print("1..0 # Skip: Needs threads::shared 0.92 or later\n");
exit(0);
use ExtUtils::testlib;
use threads;
-use threads::shared;
BEGIN {
+ eval {
+ require threads::shared;
+ import threads::shared;
+ };
+ if ($@ || ! $threads::shared::threads_shared) {
+ print("1..0 # Skip: threads::shared not available\n");
+ exit(0);
+ }
+
$| = 1;
print("1..17\n"); ### Number of tests that will be run ###
};
use ExtUtils::testlib;
use threads;
-use threads::shared;
BEGIN {
+ eval {
+ require threads::shared;
+ import threads::shared;
+ };
+ if ($@ || ! $threads::shared::threads_shared) {
+ print("1..0 # Skip: threads::shared not available\n");
+ exit(0);
+ }
+
local $SIG{'HUP'} = sub {};
my $thr = threads->create(sub {});
eval { $thr->kill('HUP') };
return ($ok);
}
+use threads;
+
BEGIN {
+ eval {
+ require threads::shared;
+ import threads::shared;
+ };
+ if ($@ || ! $threads::shared::threads_shared) {
+ print("1..0 # Skip: threads::shared not available\n");
+ exit(0);
+ }
+
$| = 1;
print("1..12\n"); ### Number of tests that will be run ###
};
-use threads;
-use threads::shared;
ok(1, 1, 'Loaded');
### Start of Testing ###
use ExtUtils::testlib;
+use threads;
+
BEGIN {
+ eval {
+ require threads::shared;
+ import threads::shared;
+ };
+ if ($@ || ! $threads::shared::threads_shared) {
+ print("1..0 # Skip: threads::shared not available\n");
+ exit(0);
+ }
+
$| = 1;
if ($] == 5.008) {
print("1..11\n"); ### Number of tests that will be run ###
}
};
-use threads;
-use threads::shared;
print("ok 1 - Loaded\n");
### Start of Testing ###
use ExtUtils::testlib;
+use threads;
+
BEGIN {
+ eval {
+ require threads::shared;
+ import threads::shared;
+ };
+ if ($@ || ! $threads::shared::threads_shared) {
+ print("1..0 # Skip: threads::shared not available\n");
+ exit(0);
+ }
+
$| = 1;
print("1..31\n"); ### Number of tests that will be run ###
};
-use threads;
-use threads::shared;
print("ok 1 - Loaded\n");
### Start of Testing ###
use strict;
use warnings;
-our $VERSION = '1.31';
+our $VERSION = '1.32';
my $XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
=head1 VERSION
-This document describes threads version 1.31
+This document describes threads version 1.32
=head1 SYNOPSIS
Creating threads inside C<BEGIN>, C<CHECK> or C<INIT> blocks should not be
relied upon. Depending on the Perl version and the application code, results
-may range from success, to (apparently harmless) warnings of leaked scalar,
+may range from success, to (apparently harmless) warnings of leaked scalar, or
all the way up to crashing of the Perl interpreter.
=item Unsafe signals
Returning closures from threads should not be relied upon. Depending of the
Perl version and the application code, results may range from success, to
-(apparently harmless) warnings of leaked scalar, all the way up to crashing of
-the Perl interpreter.
+(apparently harmless) warnings of leaked scalar, or all the way up to crashing
+of the Perl interpreter.
=item Perl Bugs and the CPAN Version of L<threads>
L<http://www.cpanforum.com/dist/threads>
Annotated POD for L<threads>:
-L<http://annocpan.org/~JDHEDDEN/threads-1.31/shared.pm>
+L<http://annocpan.org/~JDHEDDEN/threads-1.32/shared.pm>
L<threads::shared>, L<perlthrtut>
/* Try to get thread's actual stack size */
{
size_t stacksize;
- if (! pthread_attr_getstacksize(&attr, &stacksize)) {
- if (stacksize) {
+#ifdef HPUX1020
+ stacksize = pthread_attr_getstacksize(attr);
+#else
+ if (! pthread_attr_getstacksize(&attr, &stacksize))
+#endif
+ if (stacksize > 0) {
thread->stack_size = (IV)stacksize;
}
- }
}
# endif
}