summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry D. Hedden <jdhedden@cpan.org>2008-02-22 11:31:02 -0500
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2008-02-25 06:47:17 +0000
commit33d16ee73507a82920495bd827b79f06d56e1cb4 (patch)
treedc5e3d89c5851d73534c58401889c58d008408c5
parent7ef93cb2ba7dd1718be26a5d315eca2414c7da42 (diff)
downloadperl-33d16ee73507a82920495bd827b79f06d56e1cb4.tar.gz
threads::shared 1.17
From: "Jerry D. Hedden" <jdhedden@cpan.org> Message-ID: <1ff86f510802221331u48f85e8cg884c02a145dbee10@mail.gmail.com> p4raw-id: //depot/perl@33360
-rwxr-xr-xext/threads/shared/Makefile.PL21
-rw-r--r--ext/threads/shared/shared.pm13
-rw-r--r--ext/threads/shared/shared.xs6
-rw-r--r--ext/threads/shared/t/0nothread.t5
-rw-r--r--ext/threads/shared/t/disabled.t5
5 files changed, 33 insertions, 17 deletions
diff --git a/ext/threads/shared/Makefile.PL b/ext/threads/shared/Makefile.PL
index ac35f2a8dd..b59d1c9684 100755
--- a/ext/threads/shared/Makefile.PL
+++ b/ext/threads/shared/Makefile.PL
@@ -55,14 +55,13 @@ if (grep { $_ eq 'PERL_CORE=1' } @ARGV) {
# Verify that a 'C' compiler is available
if (! have_cc()) {
- die("No 'C' compiler found to build 'threads'\n");
+ die("No 'C' compiler found to build 'threads::shared'\n");
}
push(@conditional_params, 'DEFINE' => '-DHAS_PPPORT_H',
'PREREQ_PM' => {
'strict' => 0,
'warnings' => 0,
- 'threads' => 0,
'Config' => 0,
'Carp' => 0,
'XSLoader' => 0,
@@ -93,4 +92,22 @@ WriteMakefile(
@conditional_params
);
+# Additional 'make' targets
+sub MY::postamble
+{
+ return <<'_EXTRAS_';
+fixfiles:
+ @dos2unix `cat MANIFEST`
+ @$(CHMOD) 644 `cat MANIFEST`
+ @$(CHMOD) 755 examples/*.pl
+
+ppport:
+ @( cd /tmp; perl -e 'use Devel::PPPort; Devel::PPPort::WriteFile("ppport.h");' )
+ @if ! cmp -s ppport.h /tmp/ppport.h; then \
+ ( tkdiff ppport.h /tmp/ppport.h & ); \
+ perl /tmp/ppport.h; \
+ fi
+_EXTRAS_
+}
+
# EOF
diff --git a/ext/threads/shared/shared.pm b/ext/threads/shared/shared.pm
index 67346856f7..f2aaf27aac 100644
--- a/ext/threads/shared/shared.pm
+++ b/ext/threads/shared/shared.pm
@@ -5,7 +5,7 @@ use 5.008;
use strict;
use warnings;
-our $VERSION = '1.15';
+our $VERSION = '1.17';
my $XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
@@ -73,7 +73,7 @@ threads::shared - Perl extension for sharing data structures between threads
=head1 VERSION
-This document describes threads::shared version 1.15
+This document describes threads::shared version 1.17
=head1 SYNOPSIS
@@ -315,8 +315,11 @@ works on shared objects such that I<blessings> propagate across threads.
=head1 NOTES
-threads::shared is designed to disable itself silently if threads are not
-available. If you want access to threads, you must C<use threads> before you
+L<threads::shared> is designed to disable itself silently if threads are not
+available. This allows you to write modules and packages that can be used
+in both threaded and non-threaded applications.
+
+If you want access to threads, you must C<use threads> before you
C<use threads::shared>. L<threads> will emit a warning if you use it after
L<threads::shared>.
@@ -368,7 +371,7 @@ L<threads::shared> Discussion Forum on CPAN:
L<http://www.cpanforum.com/dist/threads-shared>
Annotated POD for L<threads::shared>:
-L<http://annocpan.org/~JDHEDDEN/threads-shared-1.15/shared.pm>
+L<http://annocpan.org/~JDHEDDEN/threads-shared-1.17/shared.pm>
Source repository:
L<http://code.google.com/p/threads-shared/>
diff --git a/ext/threads/shared/shared.xs b/ext/threads/shared/shared.xs
index 7decc4da6e..7043f290e4 100644
--- a/ext/threads/shared/shared.xs
+++ b/ext/threads/shared/shared.xs
@@ -1033,9 +1033,15 @@ sharedsv_array_mg_free(pTHX_ SV *sv, MAGIC *mg)
* This is called when perl is about to access an element of
* the array -
*/
+#if PERL_VERSION >= 11
int
sharedsv_array_mg_copy(pTHX_ SV *sv, MAGIC* mg,
SV *nsv, const char *name, I32 namlen)
+#else
+int
+sharedsv_array_mg_copy(pTHX_ SV *sv, MAGIC* mg,
+ SV *nsv, const char *name, int namlen)
+#endif
{
MAGIC *nmg = sv_magicext(nsv,mg->mg_obj,
toLOWER(mg->mg_type),&sharedsv_elem_vtbl,
diff --git a/ext/threads/shared/t/0nothread.t b/ext/threads/shared/t/0nothread.t
index 0808277787..f92dc759c4 100644
--- a/ext/threads/shared/t/0nothread.t
+++ b/ext/threads/shared/t/0nothread.t
@@ -6,11 +6,6 @@ BEGIN {
chdir 't';
unshift @INC, '../lib';
}
- use Config;
- if (! $Config{'useithreads'}) {
- print("1..0 # Skip: Perl not compiled with 'useithreads'\n");
- exit(0);
- }
}
use Test::More (tests => 53);
diff --git a/ext/threads/shared/t/disabled.t b/ext/threads/shared/t/disabled.t
index 8597f90cd9..e5ffc6125a 100644
--- a/ext/threads/shared/t/disabled.t
+++ b/ext/threads/shared/t/disabled.t
@@ -6,11 +6,6 @@ BEGIN {
chdir 't';
unshift @INC, '../lib';
}
- use Config;
- if (! $Config{'useithreads'}) {
- print("1..0 # Skip: Perl not compiled with 'useithreads'\n");
- exit(0);
- }
}
use Test;