bb2405c
From 9334f9fbc3fe291eb1791ff7f2bf93b9e713d4b0 Mon Sep 17 00:00:00 2001
bb2405c
From: Jitka Plesnikova <jplesnik@redhat.com>
bb2405c
Date: Thu, 6 May 2021 10:02:15 +0200
bb2405c
Subject: [PATCH] Upgrade to 2.26
bb2405c
bb2405c
---
bb2405c
 lib/threads.pm |  4 ++--
bb2405c
 t/libc.t       |  6 ++++++
bb2405c
 threads.xs     | 18 +++++++++---------
bb2405c
 3 files changed, 17 insertions(+), 11 deletions(-)
bb2405c
bb2405c
diff --git a/lib/threads.pm b/lib/threads.pm
bb2405c
index ee201a2..4453a8d 100644
bb2405c
--- a/lib/threads.pm
bb2405c
+++ b/lib/threads.pm
bb2405c
@@ -5,7 +5,7 @@ use 5.008;
bb2405c
 use strict;
bb2405c
 use warnings;
bb2405c
 
bb2405c
-our $VERSION = '2.25';      # remember to update version in POD!
bb2405c
+our $VERSION = '2.26';      # remember to update version in POD!
bb2405c
 my $XS_VERSION = $VERSION;
bb2405c
 $VERSION = eval $VERSION;
bb2405c
 
bb2405c
@@ -134,7 +134,7 @@ threads - Perl interpreter-based threads
bb2405c
 
bb2405c
 =head1 VERSION
bb2405c
 
bb2405c
-This document describes threads version 2.25
bb2405c
+This document describes threads version 2.26
bb2405c
 
bb2405c
 =head1 WARNING
bb2405c
 
bb2405c
diff --git a/t/libc.t b/t/libc.t
bb2405c
index 4f6f6ed..6595894 100644
bb2405c
--- a/t/libc.t
bb2405c
+++ b/t/libc.t
bb2405c
@@ -9,6 +9,12 @@ BEGIN {
bb2405c
         skip_all(q/Perl not compiled with 'useithreads'/);
bb2405c
     }
bb2405c
 
bb2405c
+    my $time_out_factor = $ENV{PERL_TEST_TIME_OUT_FACTOR} || 1;
bb2405c
+    $time_out_factor = 1 if $time_out_factor < 1;
bb2405c
+
bb2405c
+    # Guard against bugs that result in deadlock
bb2405c
+    watchdog(1 * 60 * $time_out_factor);
bb2405c
+
bb2405c
     plan(11);
bb2405c
 }
bb2405c
 
bb2405c
diff --git a/threads.xs b/threads.xs
bb2405c
index ab64dc0..e544eba 100644
bb2405c
--- a/threads.xs
bb2405c
+++ b/threads.xs
bb2405c
@@ -421,7 +421,7 @@ STATIC const MGVTBL ithread_vtbl = {
bb2405c
     ithread_mg_free,    /* free */
bb2405c
     0,                  /* copy */
bb2405c
     ithread_mg_dup,     /* dup */
bb2405c
-#if (PERL_VERSION > 8) || (PERL_VERSION == 8 && PERL_SUBVERSION > 8)
bb2405c
+#if PERL_VERSION_GT(5,8,8)
bb2405c
     0                   /* local */
bb2405c
 #endif
bb2405c
 };
bb2405c
@@ -751,7 +751,7 @@ S_ithread_create(
bb2405c
     AV          *params;
bb2405c
     SV          **array;
bb2405c
 
bb2405c
-#if PERL_VERSION <= 8 && PERL_SUBVERSION <= 7
bb2405c
+#if PERL_VERSION_LE(5,8,7)
bb2405c
     SV         **tmps_tmp = PL_tmps_stack;
bb2405c
     IV           tmps_ix  = PL_tmps_ix;
bb2405c
 #endif
bb2405c
@@ -849,7 +849,7 @@ S_ithread_create(
bb2405c
      * context for the duration of our work for new interpreter.
bb2405c
      */
bb2405c
     {
bb2405c
-#if (PERL_VERSION > 13) || (PERL_VERSION == 13 && PERL_SUBVERSION > 1)
bb2405c
+#if PERL_VERSION_GE(5,13,2)
bb2405c
         CLONE_PARAMS *clone_param = Perl_clone_params_new(aTHX, thread->interp);
bb2405c
 #else
bb2405c
         CLONE_PARAMS clone_param_s;
bb2405c
@@ -859,7 +859,7 @@ S_ithread_create(
bb2405c
 
bb2405c
         MY_CXT_CLONE;
bb2405c
 
bb2405c
-#if (PERL_VERSION < 13) || (PERL_VERSION == 13 && PERL_SUBVERSION <= 1)
bb2405c
+#if PERL_VERSION_LT(5,13,2)
bb2405c
         clone_param->flags = 0;
bb2405c
 #endif
bb2405c
 
bb2405c
@@ -886,7 +886,7 @@ S_ithread_create(
bb2405c
            perl_clone() and sv_dup_inc(). Hence copy the parameters
bb2405c
            somewhere under our control first, before duplicating.  */
bb2405c
         if (num_params) {
bb2405c
-#if (PERL_VERSION > 8)
bb2405c
+#if PERL_VERSION_GE(5,9,0)
bb2405c
             Copy(parent_perl->Istack_base + params_start, array, num_params, SV *);
bb2405c
 #else
bb2405c
             Copy(parent_perl->Tstack_base + params_start, array, num_params, SV *);
bb2405c
@@ -897,11 +897,11 @@ S_ithread_create(
bb2405c
             }
bb2405c
         }
bb2405c
 
bb2405c
-#if (PERL_VERSION > 13) || (PERL_VERSION == 13 && PERL_SUBVERSION > 1)
bb2405c
+#if PERL_VERSION_GE(5,13,2)
bb2405c
         Perl_clone_params_del(clone_param);
bb2405c
 #endif
bb2405c
 
bb2405c
-#if PERL_VERSION <= 8 && PERL_SUBVERSION <= 7
bb2405c
+#if PERL_VERSION_LT(5,8,8)
bb2405c
         /* The code below checks that anything living on the tmps stack and
bb2405c
          * has been cloned (so it lives in the ptr_table) has a refcount
bb2405c
          * higher than 0.
bb2405c
@@ -1339,7 +1339,7 @@ ithread_join(...)
bb2405c
         /* Get the return value from the call_sv */
bb2405c
         /* Objects do not survive this process - FIXME */
bb2405c
         if ((thread->gimme & G_WANT) != G_VOID) {
bb2405c
-#if (PERL_VERSION < 13) || (PERL_VERSION == 13 && PERL_SUBVERSION <= 1)
bb2405c
+#if PERL_VERSION_LT(5,13,2)
bb2405c
             AV *params_copy;
bb2405c
             PerlInterpreter *other_perl;
bb2405c
             CLONE_PARAMS clone_params;
bb2405c
@@ -1766,7 +1766,7 @@ ithread_error(...)
bb2405c
 
bb2405c
         /* If thread died, then clone the error into the calling thread */
bb2405c
         if (thread->state & PERL_ITHR_DIED) {
bb2405c
-#if (PERL_VERSION < 13) || (PERL_VERSION == 13 && PERL_SUBVERSION <= 1)
bb2405c
+#if PERL_VERSION_LT(5,13,2)
bb2405c
             PerlInterpreter *other_perl;
bb2405c
             CLONE_PARAMS clone_params;
bb2405c
             ithread *current_thread;
bb2405c
-- 
bb2405c
2.30.2
bb2405c