From: Jerry D. Hedden Date: Mon, 8 May 2006 10:23:33 +0000 (-0700) Subject: 'threads' patch to fix threaded build on Win32 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d305c2c92e46701c9eb2a048c9a73c330d106b35;p=p5sagit%2Fp5-mst-13.2.git 'threads' patch to fix threaded build on Win32 From: "Jerry D. Hedden" Message-ID: <20060508102333.fb30e530d17747c2b054d625b8945d88.1e447744fc.wbe@email.secureserver.net> p4raw-id: //depot/perl@28134 --- diff --git a/ext/threads/Changes b/ext/threads/Changes index 6daa99e..032bca8 100755 --- a/ext/threads/Changes +++ b/ext/threads/Changes @@ -1,5 +1,8 @@ Revision history for Perl extension threads. +1.26 Mon May 8 13:18:29 EDT 2006 + - Fix for Win32 build WRT page size + 1.25 Thu May 4 12:34:02 EDT 2006 - Final sync with blead - Lock counters in tests diff --git a/ext/threads/README b/ext/threads/README index a324595..6283135 100755 --- a/ext/threads/README +++ b/ext/threads/README @@ -1,4 +1,4 @@ -threads version 1.25 +threads version 1.26 ==================== This module needs perl 5.8.0 or later compiled with 'useithreads'. diff --git a/ext/threads/threads.pm b/ext/threads/threads.pm index af2343b..6a28940 100755 --- a/ext/threads/threads.pm +++ b/ext/threads/threads.pm @@ -5,7 +5,7 @@ use 5.008; use strict; use warnings; -our $VERSION = '1.25'; +our $VERSION = '1.26'; my $XS_VERSION = $VERSION; $VERSION = eval $VERSION; @@ -102,7 +102,7 @@ threads - Perl interpreter-based threads =head1 VERSION -This document describes threads version 1.25 +This document describes threads version 1.26 =head1 SYNOPSIS @@ -502,7 +502,7 @@ L Discussion Forum on CPAN: L Annotated POD for L: -L +L L, L diff --git a/ext/threads/threads.xs b/ext/threads/threads.xs index 9593781..83d1afa 100755 --- a/ext/threads/threads.xs +++ b/ext/threads/threads.xs @@ -32,6 +32,9 @@ typedef perl_os_thread pthread_t; # define PERL_THREAD_DETACH(t) pthread_detach((t)) # endif #endif +#if !defined(HAS_GETPAGESIZE) && defined(I_SYS_PARAM) +# include +#endif /* Values for 'state' member */ #define PERL_ITHR_JOINABLE 0 @@ -270,17 +273,13 @@ good_stack_size(pTHX_ IV stack_size) /* Round up to page size boundary */ if (page_size <= 0) { -#ifdef PL_mmap_page_size - page_size = PL_mmap_page_size; -#else -# ifdef HAS_MMAP -# if defined(HAS_SYSCONF) && (defined(_SC_PAGESIZE) || defined(_SC_MMAP_PAGE_SIZE)) +#if defined(HAS_SYSCONF) && (defined(_SC_PAGESIZE) || defined(_SC_MMAP_PAGE_SIZE)) SETERRNO(0, SS_NORMAL); -# ifdef _SC_PAGESIZE +# ifdef _SC_PAGESIZE page_size = sysconf(_SC_PAGESIZE); -# else +# else page_size = sysconf(_SC_MMAP_PAGE_SIZE); -# endif +# endif if ((long)page_size < 0) { if (errno) { SV * const error = get_sv("@", FALSE); @@ -290,20 +289,18 @@ good_stack_size(pTHX_ IV stack_size) Perl_croak(aTHX_ "PANIC: sysconf: pagesize unknown"); } } -# else -# ifdef HAS_GETPAGESIZE +#else +# ifdef HAS_GETPAGESIZE page_size = getpagesize(); -# else -# if defined(I_SYS_PARAM) && defined(PAGESIZE) - page_size = PAGESIZE; -# endif -# endif - if (page_size <= 0) - Perl_croak(aTHX_ "PANIC: bad pagesize %" IVdf, (IV)page_size); -# endif # else +# if defined(I_SYS_PARAM) && defined(PAGESIZE) + page_size = PAGESIZE; +# else page_size = 8192; /* A conservative default */ +# endif # endif + if (page_size <= 0) + Perl_croak(aTHX_ "PANIC: bad pagesize %" IVdf, (IV)page_size); #endif } stack_size = ((stack_size + (page_size - 1)) / page_size) * page_size;