From: Jerry D. Hedden Date: Tue, 21 Nov 2006 08:26:28 +0000 (-0800) Subject: threads 1.52 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=11db694d93e1cedbee25893e6700da4520b3d1a8;p=p5sagit%2Fp5-mst-13.2.git threads 1.52 From: "Jerry D. Hedden" Message-ID: <204140.57721.qm@web30207.mail.mud.yahoo.com> p4raw-id: //depot/perl@29342 --- diff --git a/ext/threads/Changes b/ext/threads/Changes index a2b2d39..22d8122 100755 --- a/ext/threads/Changes +++ b/ext/threads/Changes @@ -1,5 +1,8 @@ Revision history for Perl extension threads. +1.52 Tue Nov 21 11:04:03 EST 2006 + - Fix compiler warnings + 1.51 Wed Nov 15 14:25:30 EST 2006 - Thread destruction fix diff --git a/ext/threads/README b/ext/threads/README index 1751704..9399daf 100755 --- a/ext/threads/README +++ b/ext/threads/README @@ -1,4 +1,4 @@ -threads version 1.51 +threads version 1.52 ==================== This module exposes interpreter threads to the Perl level. diff --git a/ext/threads/t/exit.t b/ext/threads/t/exit.t index 6c3043b..3e4b2c3 100644 --- a/ext/threads/t/exit.t +++ b/ext/threads/t/exit.t @@ -56,7 +56,7 @@ my $rc = $thr->join(); ok(! defined($rc), 'Exited: threads->exit()'); -run_perl(prog => 'use threads 1.51;' . +run_perl(prog => 'use threads 1.52;' . 'threads->exit(86);' . 'exit(99);', nolib => ($ENV{PERL_CORE}) ? 0 : 1, @@ -104,7 +104,7 @@ $rc = $thr->join(); ok(! defined($rc), 'Exited: $thr->set_thread_exit_only'); -run_perl(prog => 'use threads 1.51 qw(exit thread_only);' . +run_perl(prog => 'use threads 1.52 qw(exit thread_only);' . 'threads->create(sub { exit(99); })->join();' . 'exit(86);', nolib => ($ENV{PERL_CORE}) ? 0 : 1, @@ -112,7 +112,7 @@ run_perl(prog => 'use threads 1.51 qw(exit thread_only);' . is($?>>8, 86, "'use threads 'exit' => 'thread_only'"); -my $out = run_perl(prog => 'use threads 1.51;' . +my $out = run_perl(prog => 'use threads 1.52;' . 'threads->create(sub {' . ' exit(99);' . '})->join();' . @@ -124,7 +124,7 @@ is($?>>8, 99, "exit(status) in thread"); like($out, '1 finished and unjoined', "exit(status) in thread"); -$out = run_perl(prog => 'use threads 1.51 qw(exit thread_only);' . +$out = run_perl(prog => 'use threads 1.52 qw(exit thread_only);' . 'threads->create(sub {' . ' threads->set_thread_exit_only(0);' . ' exit(99);' . @@ -137,7 +137,7 @@ is($?>>8, 99, "set_thread_exit_only(0)"); like($out, '1 finished and unjoined', "set_thread_exit_only(0)"); -run_perl(prog => 'use threads 1.51;' . +run_perl(prog => 'use threads 1.52;' . 'threads->create(sub {' . ' $SIG{__WARN__} = sub { exit(99); };' . ' die();' . diff --git a/ext/threads/t/thread.t b/ext/threads/t/thread.t index b3b716f..4c6c583 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.51;' . +run_perl(prog => 'use threads 1.52;' . '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 303d035..702892e 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.51'; +our $VERSION = '1.52'; my $XS_VERSION = $VERSION; $VERSION = eval $VERSION; @@ -133,7 +133,7 @@ threads - Perl interpreter-based threads =head1 VERSION -This document describes threads version 1.51 +This document describes threads version 1.52 =head1 SYNOPSIS @@ -938,7 +938,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 3a1ea14..c734108 100755 --- a/ext/threads/threads.xs +++ b/ext/threads/threads.xs @@ -929,7 +929,7 @@ ithread_list(...) ithread *thread; int list_context; IV count = 0; - int want_running; + int want_running = 0; dMY_POOL; PPCODE: /* Class method only */ @@ -990,7 +990,7 @@ ithread_self(...) ithread *thread; CODE: /* Class method only */ - if (SvROK(ST(0))) { + if ((items != 1) || SvROK(ST(0))) { Perl_croak(aTHX_ "Usage: threads->self()"); } classname = (char *)SvPV_nolen(ST(0)); @@ -1006,6 +1006,7 @@ ithread_tid(...) PREINIT: ithread *thread; CODE: + PERL_UNUSED_VAR(items); thread = S_SV_to_ithread(aTHX_ ST(0)); XST_mUV(0, thread->tid); /* XSRETURN(1); - implied */ @@ -1027,7 +1028,7 @@ ithread_join(...) dMY_POOL; PPCODE: /* Object method only */ - if (! sv_isobject(ST(0))) { + if ((items != 1) || ! sv_isobject(ST(0))) { Perl_croak(aTHX_ "Usage: $thr->join()"); } @@ -1108,6 +1109,7 @@ ithread_join(...) void ithread_yield(...) CODE: + PERL_UNUSED_VAR(items); YIELD; @@ -1116,9 +1118,10 @@ ithread_detach(...) PREINIT: ithread *thread; int detach_err; - int cleanup = 0; dMY_POOL; CODE: + PERL_UNUSED_VAR(items); + /* Check if the thread is detachable */ thread = S_SV_to_ithread(aTHX_ ST(0)); if ((detach_err = (thread->state & (PERL_ITHR_DETACHED|PERL_ITHR_JOINED)))) { @@ -1165,7 +1168,7 @@ ithread_kill(...) } /* Object method only */ - if (! sv_isobject(ST(0))) { + if ((items != 2) || ! sv_isobject(ST(0))) { Perl_croak(aTHX_ "Usage: $thr->kill('SIG...')"); } @@ -1200,6 +1203,7 @@ ithread_kill(...) void ithread_DESTROY(...) CODE: + PERL_UNUSED_VAR(items); sv_unmagic(SvRV(ST(0)), PERL_MAGIC_shared_scalar); @@ -1208,6 +1212,8 @@ ithread_equal(...) PREINIT: int are_equal = 0; CODE: + PERL_UNUSED_VAR(items); + /* Compares TIDs to determine thread equality */ if (sv_isobject(ST(0)) && sv_isobject(ST(1))) { ithread *thr1 = INT2PTR(ithread *, SvIV(SvRV(ST(0)))); @@ -1275,6 +1281,7 @@ ithread__handle(...); PREINIT: ithread *thread; CODE: + PERL_UNUSED_VAR(items); thread = S_SV_to_ithread(aTHX_ ST(0)); #ifdef WIN32 XST_mUV(0, PTR2UV(&thread->handle)); @@ -1290,6 +1297,7 @@ ithread_get_stack_size(...) IV stack_size; dMY_POOL; CODE: + PERL_UNUSED_VAR(items); if (sv_isobject(ST(0))) { /* $thr->get_stack_size() */ ithread *thread = INT2PTR(ithread *, SvIV(SvRV(ST(0)))); @@ -1327,7 +1335,7 @@ ithread_is_running(...) ithread *thread; CODE: /* Object method only */ - if (! sv_isobject(ST(0))) { + if ((items != 1) || ! sv_isobject(ST(0))) { Perl_croak(aTHX_ "Usage: $thr->is_running()"); } @@ -1341,6 +1349,7 @@ ithread_is_detached(...) PREINIT: ithread *thread; CODE: + PERL_UNUSED_VAR(items); thread = S_SV_to_ithread(aTHX_ ST(0)); ST(0) = (thread->state & PERL_ITHR_DETACHED) ? &PL_sv_yes : &PL_sv_no; /* XSRETURN(1); - implied */ @@ -1352,7 +1361,7 @@ ithread_is_joinable(...) ithread *thread; CODE: /* Object method only */ - if (! sv_isobject(ST(0))) { + if ((items != 1) || ! sv_isobject(ST(0))) { Perl_croak(aTHX_ "Usage: $thr->is_joinable()"); } @@ -1370,6 +1379,7 @@ ithread_wantarray(...) PREINIT: ithread *thread; CODE: + PERL_UNUSED_VAR(items); thread = S_SV_to_ithread(aTHX_ ST(0)); ST(0) = (thread->gimme & G_ARRAY) ? &PL_sv_yes : (thread->gimme & G_VOID) ? &PL_sv_undef