From 3ceb02cdefdcbba303bf67775d885ec9818e651f Mon Sep 17 00:00:00 2001 From: "Jerry D. Hedden" Date: Mon, 10 Jul 2006 06:28:25 -0700 Subject: [PATCH] threads 1.36 - Signalling terminated threads core dumps From: "Jerry D. Hedden" Message-ID: <20060710132825.fb30e530d17747c2b054d625b8945d88.5bdc82d2c0.wbe@email.secureserver.net> p4raw-id: //depot/perl@28543 --- ext/threads/Changes | 5 ++++- ext/threads/README | 9 +++------ ext/threads/t/kill.t | 4 +++- ext/threads/t/thread.t | 2 +- ext/threads/threads.pm | 6 +++--- ext/threads/threads.xs | 2 +- 6 files changed, 15 insertions(+), 13 deletions(-) diff --git a/ext/threads/Changes b/ext/threads/Changes index 9e15b8b..71d6313 100755 --- a/ext/threads/Changes +++ b/ext/threads/Changes @@ -1,6 +1,9 @@ Revision history for Perl extension threads. -1.35 - Mon Jul 10 09:44:47 EDT 2006 +1.36 Mon Jul 10 15:58:13 EDT 2006 + - Ignore signals sent to terminated threads + +1.35 Mon Jul 10 09:44:47 EDT 2006 - Upgraded ppport.h to Devel::PPPort 3.09 - Fix for Borland compiler diff --git a/ext/threads/README b/ext/threads/README index c331a36..7269f37 100755 --- a/ext/threads/README +++ b/ext/threads/README @@ -1,8 +1,7 @@ -threads version 1.35 +threads version 1.36 ==================== -This module needs perl 5.8.0 or later compiled with 'useithreads'. -It exposes interpreter threads to the Perl level. +This module exposes interpreter threads to the Perl level. INSTALLATION @@ -15,9 +14,7 @@ To install this module type the following: DEPENDENCIES -This module requires these other modules and libraries: - - threads::shared +This module needs perl 5.8.0 or later compiled with 'useithreads'. COPYRIGHT AND LICENCE diff --git a/ext/threads/t/kill.t b/ext/threads/t/kill.t index 5d25db3..aff5dd0 100644 --- a/ext/threads/t/kill.t +++ b/ext/threads/t/kill.t @@ -201,9 +201,11 @@ threads->yield(); sleep(1); # Terminate the thread -ok($thr->kill('TERM'), 'Signalled thread to terminate'); +ok($thr->kill('TERM') == $thr, 'Signalled thread to terminate'); $rc = $thr->join(); ok($rc eq 'OKAY', 'Thread return value'); +ok($thr->kill('TERM'), 'Ignore signal to terminated thread'); + # EOF diff --git a/ext/threads/t/thread.t b/ext/threads/t/thread.t index 5982236..d29d523 100644 --- a/ext/threads/t/thread.t +++ b/ext/threads/t/thread.t @@ -171,7 +171,7 @@ package main; # bugid #24165 -run_perl(prog => 'use threads 1.35; +run_perl(prog => 'use threads 1.36; sub a{threads->create(shift)} $t = a sub{}; $t->tid; $t->join; $t->tid', nolib => ($ENV{PERL_CORE}) ? 0 : 1, diff --git a/ext/threads/threads.pm b/ext/threads/threads.pm index 0152df5..04e0692 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.35'; +our $VERSION = '1.36'; my $XS_VERSION = $VERSION; $VERSION = eval $VERSION; @@ -113,7 +113,7 @@ threads - Perl interpreter-based threads =head1 VERSION -This document describes threads version 1.35 +This document describes threads version 1.36 =head1 SYNOPSIS @@ -804,7 +804,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 1f3cad1..c648bcd 100755 --- a/ext/threads/threads.xs +++ b/ext/threads/threads.xs @@ -1079,7 +1079,7 @@ ithread_kill(...) /* Set the signal for the thread */ thread = SV_to_ithread(aTHX_ ST(0)); MUTEX_LOCK(&thread->mutex); - { + if (thread->interp) { dTHXa(thread->interp); PL_psig_pend[signal]++; PL_sig_pending = 1; -- 2.7.4