Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
5c1bcd3
threads: bump version to 2.46
iabyn May 6, 2026
03f3482
make PL_veto_switch_non_tTHX_context per-thread
iabyn Mar 14, 2026
705a237
threads and locales: add some code comments
iabyn Mar 20, 2026
e2df26c
threads.xs: add more join/detach code comments
iabyn Apr 3, 2026
04614bf
threads.xs: refactor: rename some create() vars
iabyn Apr 2, 2026
f106729
threads.xs: refactor: create(): rename variable
iabyn Apr 1, 2026
c796699
threads.xs: add new thread to pool later
iabyn Apr 1, 2026
87cc7ab
threads.xs: refactor: move create mutex locking
iabyn Apr 1, 2026
56d6bbb
threads.xs: refactor: move thread mutex unlocking
iabyn Apr 1, 2026
de83a98
threads.xs: dont hold global lock in thread create
iabyn Apr 2, 2026
c3c89c8
threads.xs: use consistent lock ordering.
iabyn Apr 4, 2026
05e45cc
threads.xs: refactor: avoid duplicate braces
iabyn Apr 5, 2026
e07953d
threads.xs: add some locking code comments
iabyn Apr 5, 2026
94a7ca7
threads.xs: better comment on destruction
iabyn Apr 6, 2026
689b593
threads.xs: set aTHX to null at end
iabyn Apr 7, 2026
69b62b7
threads.xs: add workaround for helgrind false +ve
iabyn May 13, 2026
ab0fdf4
threads: block.t: add comments explaining it
iabyn May 14, 2026
d00d518
threads.xs: add thread->pool field to fix race
iabyn May 19, 2026
601ca8a
threads.xs: set thread->interp to NULL before free
iabyn May 19, 2026
34f2004
threads.xs: remove PERL_ITHR_NONVIABLE flag
iabyn May 19, 2026
03da5a5
threads.xs: reindent
iabyn May 19, 2026
64d2c8e
threads.xs: remove PERL_ITHR_UNCALLABLE flag
iabyn May 19, 2026
5e583b5
threads.xs: remove PREFIX = ithread_
iabyn May 22, 2026
56a871b
threads::shared: bump version to 1.74
iabyn May 6, 2026
262f523
threads::shared: add t/err.t
iabyn Apr 9, 2026
65464d3
threads::shared: set mutex when dup rc++
iabyn Apr 4, 2026
de59b26
threads::shared: refactor: unify common cond code
iabyn Apr 8, 2026
a9585f9
threads::shared: add some cond_wait code comments
iabyn Apr 8, 2026
4eb17ed
threads::shared: refactor: cond_wait() var names
iabyn Apr 8, 2026
6b48e87
threads::shared: refactor: share code on sig/brdct
iabyn Apr 8, 2026
fb8a595
threads::shared: refactor: cond_signal() var names
iabyn Apr 8, 2026
f9351f2
threads::shared: track cond_wait() locks
iabyn Apr 8, 2026
70fdd5a
threads::shared: add test for spurious warning
iabyn Apr 14, 2026
3ad73ce
threads::shared: avoid spurious 'not locked' warn
iabyn Apr 14, 2026
78290be
threads::shared: set mutex when signalling.
iabyn Apr 14, 2026
b1fb4c3
threads::shared::_id(), _refcnt() check arg is ref
iabyn May 19, 2026
648cc08
threads::shared::shared_clone(): ban typeglobs
iabyn May 21, 2026
e83d587
threads::shared: disallow $shared = *GLOB
iabyn May 21, 2026
6766fb5
sv_dump(): handle dumping a malformed GV
iabyn May 20, 2026
c01dab2
mg.c: clean up indenting etc of sig handling fns
iabyn Apr 17, 2026
90d1d12
Use separate allocs for PL_psig_name and psig_ptr
iabyn May 6, 2026
17dd7c6
Remove some NULL PL_sig_foo casts
iabyn May 6, 2026
f251fa0
add PERL_ATOMIC() macro
iabyn May 6, 2026
f730414
make PL_sig_foo atomic, but not by default
iabyn May 6, 2026
2b1ca33
porting/cpphdrcheck.t: add comments explaining it
iabyn May 13, 2026
50be909
Perl_rcpv_free(): do asserts within lock scope
iabyn May 19, 2026
b02d52f
Ignore -Wthread-safety in PERL_REENTRANT_UNLOCK()
iabyn May 22, 2026
19dbad9
perldelta entry for threads fixups
iabyn May 24, 2026
b9d0626
threads::shared: remove problematic err.t test
iabyn May 25, 2026
4ecaf49
threads.xs: remove unneeded locking
iabyn May 25, 2026
300363d
Perl_set_context() allow NULL argument
iabyn May 25, 2026
a4d8e96
win32 Perl_set_context(): handle NULL arg
iabyn May 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -4619,6 +4619,7 @@ dist/threads/t/stress_string.t Test with multiple threads, string cv argument.
dist/threads/t/thread.t General ithread tests from thr5005
dist/threads/t/unique.t Test unique attribute with threads
dist/threads/t/version.t Test that pod version matches code version.
dist/threads/t/zz_deadlock.t Test that code doesn't deadlock
dist/threads/threads.h threads compatibility helper
dist/threads/threads.xs ithreads
dist/threads-shared/hints/linux.pl thread shared variables
Expand All @@ -4632,6 +4633,7 @@ dist/threads-shared/t/clone.t Test shared cloning
dist/threads-shared/t/cond.t Test condition variables
dist/threads-shared/t/disabled.t Test threads::shared when threads are disabled.
dist/threads-shared/t/dualvar.t Test dual-valued variables
dist/threads-shared/t/err.t Test warnings and errors
dist/threads-shared/t/hv_refs.t Test shared hashes containing references
dist/threads-shared/t/hv_simple.t Tests for basic shared hash functionality.
dist/threads-shared/t/no_share.t Tests for disabled share on variables.
Expand Down
55 changes: 41 additions & 14 deletions dist/threads-shared/lib/threads/shared.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use Config;

use Scalar::Util qw(reftype refaddr blessed);

our $VERSION = '1.73'; # Please update the pod, too.
our $VERSION = '1.74'; # Please update the pod, too.
my $XS_VERSION = $VERSION;
$VERSION = eval $VERSION;

Expand Down Expand Up @@ -85,6 +85,23 @@ sub shared_clone
return $make_shared->(shift, {});
}

# helper function for $make_shared

sub _report_unsupported_clone {
my ($item) = @_;

my $ref_type = reftype($item);
my $category = defined $ref_type ? 'ref' : 'scalar';
$ref_type = reftype(\$item) unless defined $ref_type;

require Carp;
if (! defined($threads::shared::clone_warn)) {
Carp::croak("Unsupported $category type: ", $ref_type);
} elsif ($threads::shared::clone_warn) {
Carp::carp("Unsupported $category type: ", $ref_type);
}
}


### Internal Functions ###

Expand All @@ -93,11 +110,27 @@ sub shared_clone
$make_shared = sub {
my ($item, $cloned) = @_;

# Just return the item if
# - not a ref,
# - and not one of the unsupported types

my $ref_type = reftype($item);
if (!defined $ref_type) {
$ref_type = reftype(\$item);
# some scalar types are currently uncloneable.
# XXX probably should be more in this list.
if ($ref_type =~ /^ (GLOB|CODE) $/x) {
_report_unsupported_clone($item);
return;
}
return $item;
}

# Just return the item if:
# 1. Not a ref;
# 2. Already shared; or
# 3. Not running 'threads'.
return $item if (! ref($item) || is_shared($item) || ! $threads::threads);
# Already shared; or
# Not running 'threads'.
return $item if (is_shared($item) || ! $threads::threads);


# Check for previously cloned references
# (this takes care of circular refs as well)
Expand All @@ -109,7 +142,6 @@ $make_shared = sub {

# Make copies of array, hash and scalar refs and refs of refs
my $copy;
my $ref_type = reftype($item);

# Copy an array ref
if ($ref_type eq 'ARRAY') {
Expand Down Expand Up @@ -159,13 +191,8 @@ $make_shared = sub {
}

} else {
require Carp;
if (! defined($threads::shared::clone_warn)) {
Carp::croak("Unsupported ref type: ", $ref_type);
} elsif ($threads::shared::clone_warn) {
Carp::carp("Unsupported ref type: ", $ref_type);
}
return undef;
_report_unsupported_clone($item);
return;
}

# If input item is an object, then bless the copy into the same class
Expand Down Expand Up @@ -196,7 +223,7 @@ threads::shared - Perl extension for sharing data structures between threads

=head1 VERSION

This document describes threads::shared version 1.73
This document describes threads::shared version 1.74

=head1 SYNOPSIS

Expand Down
Loading
Loading