Skip to content

Commit

Permalink
Merge 1dee162 into 3bd97ba
Browse files Browse the repository at this point in the history
  • Loading branch information
leonerd committed Jun 23, 2021
2 parents 3bd97ba + 1dee162 commit 758ab5c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
4 changes: 2 additions & 2 deletions dist/threads/lib/threads.pm
Expand Up @@ -5,7 +5,7 @@ use 5.008;
use strict;
use warnings;

our $VERSION = '2.26'; # remember to update version in POD!
our $VERSION = '2.27'; # remember to update version in POD!
my $XS_VERSION = $VERSION;
$VERSION = eval $VERSION;

Expand Down Expand Up @@ -134,7 +134,7 @@ threads - Perl interpreter-based threads
=head1 VERSION
This document describes threads version 2.26
This document describes threads version 2.27
=head1 WARNING
Expand Down
20 changes: 12 additions & 8 deletions dist/threads/threads.xs
Expand Up @@ -46,6 +46,10 @@
# define CLANG_DIAG_RESTORE_DECL CLANG_DIAG_RESTORE dNOOP
#endif

#ifndef G_LIST
# define G_LIST G_ARRAY
#endif

#ifdef USE_ITHREADS

#ifdef __amigaos4__
Expand Down Expand Up @@ -1115,7 +1119,7 @@ ithread_create(...)
case 'A':
case 'l':
case 'L':
context = G_ARRAY;
context = G_LIST;
break;
case 's':
case 'S':
Expand All @@ -1130,11 +1134,11 @@ ithread_create(...)
}
} else if ((svp = hv_fetchs(specs, "array", 0))) {
if (SvTRUE(*svp)) {
context = G_ARRAY;
context = G_LIST;
}
} else if ((svp = hv_fetchs(specs, "list", 0))) {
if (SvTRUE(*svp)) {
context = G_ARRAY;
context = G_LIST;
}
} else if ((svp = hv_fetchs(specs, "scalar", 0))) {
if (SvTRUE(*svp)) {
Expand All @@ -1156,7 +1160,7 @@ ithread_create(...)
if (context == -1) {
context = GIMME_V; /* Implicit context */
} else {
context |= (GIMME_V & (~(G_ARRAY|G_SCALAR|G_VOID)));
context |= (GIMME_V & (~(G_LIST|G_SCALAR|G_VOID)));
}

/* Create thread */
Expand Down Expand Up @@ -1201,7 +1205,7 @@ ithread_list(...)
classname = (char *)SvPV_nolen(ST(0));

/* Calling context */
list_context = (GIMME_V == G_ARRAY);
list_context = (GIMME_V == G_LIST);

/* Running or joinable parameter */
if (items > 1) {
Expand Down Expand Up @@ -1726,9 +1730,9 @@ ithread_wantarray(...)
CODE:
PERL_UNUSED_VAR(items);
thread = S_SV_to_ithread(aTHX_ ST(0));
ST(0) = ((thread->gimme & G_WANT) == G_ARRAY) ? &PL_sv_yes :
((thread->gimme & G_WANT) == G_VOID) ? &PL_sv_undef
/* G_SCALAR */ : &PL_sv_no;
ST(0) = ((thread->gimme & G_WANT) == G_LIST) ? &PL_sv_yes :
((thread->gimme & G_WANT) == G_VOID) ? &PL_sv_undef
/* G_SCALAR */ : &PL_sv_no;
/* XSRETURN(1); - implied */


Expand Down

0 comments on commit 758ab5c

Please sign in to comment.