New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blessed scalar refs with threads::shared #8246
Comments
From jerry@hedden.usThis is a bug report for perl from jdhedden@1979.usna.com, Scalar refs do not retain blessings when stored inside threads::shared I have included a script that demonstrated the problem, and a patch to The patch also includes a test file to be added to the Perl test suite. My hope is that this patch will make it into the 5.8.8 release. ===== Start of blessed_shared_scalar_bug.pl ===== #!/usr/bin/perl use strict; use threads; use Data::Dumper; MAIN: # Create a shared, blessed array reference # Create a shared, blessed hash reference $$array[0] = bless(&threads::shared::share({}), 'yin'); my $holder = &threads::shared::share({}); $$holder{'array'} = $array; print("\nStored shared objects: ", Dumper($holder)); exit(0); ===== Start of script ===== ===== Output of demo program without patch ===== Blessed scalar: $VAR1 = bless( do{\(my $o = '3')}, 'foo' ); Stored shared objects: $VAR1 = { ================================================ ===== Output of demo program with patch ===== Blessed scalar: $VAR1 = bless( do{\(my $o = '3')}, 'foo' ); Stored shared objects: $VAR1 = { ============================================= ===== Start of patch ===== diff -r -c -N perl-5.8.7-orig/ext/threads/shared/shared.xs ===== End of patch ===== Flags: Site configuration information for perl v5.8.7: Configured by Jerry at Tue Dec 13 16:04:13 EST 2005. Summary of my perl5 (revision 5 version 8 subversion 7) configuration: Locally applied patches: @INC for perl v5.8.7: Environment for perl v5.8.7: |
From @iabynOn Tue, Dec 13, 2005 at 03:11:20PM -0800, Jerry D. Hedden wrote:
Thanks, applied as changes 26350 and 26351 -- |
The RT System itself - Status changed from 'new' to 'open' |
From guest@guest.guest.xxxxxxxxIn the POD for threads::shared, it states: C<bless> is not supported on shared references. In the current version, Should this now be removed? |
@iabyn - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#37919 (status was 'resolved')
Searchable as RT37919$
The text was updated successfully, but these errors were encountered: