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,
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,
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();' .
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);' .
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();' .
use strict;
use warnings;
-our $VERSION = '1.51';
+our $VERSION = '1.52';
my $XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
=head1 VERSION
-This document describes threads version 1.51
+This document describes threads version 1.52
=head1 SYNOPSIS
L<http://www.cpanforum.com/dist/threads>
Annotated POD for L<threads>:
-L<http://annocpan.org/~JDHEDDEN/threads-1.51/threads.pm>
+L<http://annocpan.org/~JDHEDDEN/threads-1.52/threads.pm>
L<threads::shared>, L<perlthrtut>
ithread *thread;
int list_context;
IV count = 0;
- int want_running;
+ int want_running = 0;
dMY_POOL;
PPCODE:
/* Class method only */
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));
PREINIT:
ithread *thread;
CODE:
+ PERL_UNUSED_VAR(items);
thread = S_SV_to_ithread(aTHX_ ST(0));
XST_mUV(0, thread->tid);
/* XSRETURN(1); - implied */
dMY_POOL;
PPCODE:
/* Object method only */
- if (! sv_isobject(ST(0))) {
+ if ((items != 1) || ! sv_isobject(ST(0))) {
Perl_croak(aTHX_ "Usage: $thr->join()");
}
void
ithread_yield(...)
CODE:
+ PERL_UNUSED_VAR(items);
YIELD;
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)))) {
}
/* Object method only */
- if (! sv_isobject(ST(0))) {
+ if ((items != 2) || ! sv_isobject(ST(0))) {
Perl_croak(aTHX_ "Usage: $thr->kill('SIG...')");
}
void
ithread_DESTROY(...)
CODE:
+ PERL_UNUSED_VAR(items);
sv_unmagic(SvRV(ST(0)), PERL_MAGIC_shared_scalar);
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))));
PREINIT:
ithread *thread;
CODE:
+ PERL_UNUSED_VAR(items);
thread = S_SV_to_ithread(aTHX_ ST(0));
#ifdef WIN32
XST_mUV(0, PTR2UV(&thread->handle));
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))));
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()");
}
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 */
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()");
}
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