From 7d04948ead09392ede359a8cfc2e9d5a98a9b9bf Mon Sep 17 00:00:00 2001 From: Jitka Plesnikova Date: Wed, 27 Jun 2018 01:33:43 +0200 Subject: [PATCH] Perl 5.28 rebuild --- perl-threads.spec | 16 ++++-- threads-2.21-Upgrade-to-2.22.patch | 82 ++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+), 4 deletions(-) create mode 100644 threads-2.21-Upgrade-to-2.22.patch diff --git a/perl-threads.spec b/perl-threads.spec index af67e1d..4a92a6b 100644 --- a/perl-threads.spec +++ b/perl-threads.spec @@ -1,11 +1,14 @@ +%global base_version 2.21 Name: perl-threads Epoch: 1 -Version: 2.21 -Release: 2%{?dist} +Version: 2.22 +Release: 416%{?dist} Summary: Perl interpreter-based threads License: GPL+ or Artistic URL: https://metacpan.org/release/threads -Source0: https://cpan.metacpan.org/authors/id/J/JD/JDHEDDEN/threads-%{version}.tar.gz +Source0: https://cpan.metacpan.org/authors/id/J/JD/JDHEDDEN/threads-%{base_version}.tar.gz +# Unbundled from perl 5.28.0 +Patch0: threads-2.21-Upgrade-to-2.22.patch BuildRequires: coreutils BuildRequires: findutils BuildRequires: gcc @@ -49,7 +52,8 @@ between threads. This threading model has been deprecated, and was removed as of Perl 5.10.0.) %prep -%setup -q -n threads-%{version} +%setup -q -n threads-%{base_version} +%patch0 -p1 chmod -x examples/* %build @@ -71,6 +75,10 @@ make test %{_mandir}/man3/* %changelog +* Wed Jun 27 2018 Jitka Plesnikova - 1:2.21-416 +- Upgrade to 2.22 as provided in perl-5.28.0 +- Perl 5.28 rebuild + * Fri Feb 09 2018 Fedora Release Engineering - 1:2.21-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild diff --git a/threads-2.21-Upgrade-to-2.22.patch b/threads-2.21-Upgrade-to-2.22.patch new file mode 100644 index 0000000..bc0e53a --- /dev/null +++ b/threads-2.21-Upgrade-to-2.22.patch @@ -0,0 +1,82 @@ +From a0eaa97e59b5b2ad8e2a83f8509da3787ff4b4bf Mon Sep 17 00:00:00 2001 +From: Jitka Plesnikova +Date: Thu, 24 May 2018 11:32:01 +0200 +Subject: [PATCH] Upgrade to 2.22 + +--- + lib/threads.pm | 29 ++++++++++++++++++++++++++++- + threads.xs | 4 ++++ + 2 files changed, 32 insertions(+), 1 deletion(-) + +diff --git a/lib/threads.pm b/lib/threads.pm +index 2eb926a..1b99567 100644 +--- a/lib/threads.pm ++++ b/lib/threads.pm +@@ -5,7 +5,7 @@ use 5.008; + use strict; + use warnings; + +-our $VERSION = '2.21'; # remember to update version in POD! ++our $VERSION = '2.22'; # remember to update version in POD! + my $XS_VERSION = $VERSION; + $VERSION = eval $VERSION; + +@@ -937,6 +937,33 @@ C) will affect all the threads in the application. + On MSWin32, each thread maintains its own the current working directory + setting. + ++=item Locales ++ ++Prior to Perl 5.28, locales could not be used with threads, due to various ++race conditions. Starting in that release, on systems that implement ++thread-safe locale functions, threads can be used, with some caveats. ++This includes Windows starting with Visual Studio 2005, and systems compatible ++with POSIX 2008. See L. ++ ++Each thread (except the main thread) is started using the C locale. The main ++thread is started like all other Perl programs; see L. ++You can switch locales in any thread as often as you like. ++ ++If you want to inherit the parent thread's locale, you can, in the parent, set ++a variable like so: ++ ++ $foo = POSIX::setlocale(LC_ALL, NULL); ++ ++and then pass to threads->create() a sub that closes over C<$foo>. Then, in ++the child, you say ++ ++ POSIX::setlocale(LC_ALL, $foo); ++ ++Or you can use the facilities in L to pass C<$foo>; ++or if the environment hasn't changed, in the child, do ++ ++ POSIX::setlocale(LC_ALL, ""); ++ + =item Environment variables + + Currently, on all platforms except MSWin32, all I calls (e.g., using +diff --git a/threads.xs b/threads.xs +index 4e9e31f..3da9165 100644 +--- a/threads.xs ++++ b/threads.xs +@@ -580,6 +580,8 @@ S_ithread_run(void * arg) + S_set_sigmask(&thread->initial_sigmask); + #endif + ++ thread_locale_init(); ++ + PL_perl_destruct_level = 2; + + { +@@ -665,6 +667,8 @@ S_ithread_run(void * arg) + MUTEX_UNLOCK(&thread->mutex); + MUTEX_UNLOCK(&MY_POOL.create_destruct_mutex); + ++ thread_locale_term(); ++ + /* Exit application if required */ + if (exit_app) { + (void)S_jmpenv_run(aTHX_ 2, thread, NULL, &exit_app, &exit_code); +-- +2.14.3 +