Skip to content

Commit

Permalink
4.05 Fix for non-threaded Perl
Browse files Browse the repository at this point in the history
  • Loading branch information
jdhedden committed Nov 27, 2018
1 parent 32a4b64 commit db9e3a2
Show file tree
Hide file tree
Showing 20 changed files with 72 additions and 53 deletions.
3 changes: 3 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ Revision history for Perl extension Object::InsideOut.
-
-

4.05 Tue Nov 27 03:42:46 2018
- Fix for non-threaded Perl

4.04 Wed Mar 1 04:59:11 2017
- Fix for threads::shared < 0.96

Expand Down
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Object-InsideOut version 4.04
Object-InsideOut version 4.05
=============================

This module provides comprehensive support for implementing classes using the
Expand Down
4 changes: 2 additions & 2 deletions examples/YAPI.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package Term::YAPI; {
use strict;
use warnings;

our $VERSION = '4.04';
our $VERSION = '4.05';

#####
#
Expand All @@ -22,7 +22,7 @@ package Term::YAPI; {
$threaded_okay = !$@;
}

use Object::InsideOut 4.04;
use Object::InsideOut 4.05;

# Default progress indicator is a twirling bar
my @yapi :Field
Expand Down
32 changes: 16 additions & 16 deletions lib/Bundle/Object/InsideOut.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package Bundle::Object::InsideOut;
use strict;
use warnings;

our $VERSION = '4.04';
our $VERSION = '4.05';
$VERSION = eval $VERSION;

1;
Expand All @@ -20,57 +20,57 @@ Bundle::Object::InsideOut - A bundle of modules for full Object::InsideOut suppo
=head1 CONTENTS
Test::Harness 3.36 - Used for module testing
Test::Harness 3.42 - Used for module testing
Test::Simple 1.302059 - Used for module testing
Test::Simple 1.302140 - Used for module testing
Scalar::Util 1.47 - Used by Object::InsideOut
Scalar::Util 1.50 - Used by Object::InsideOut
Pod::Escapes 1.07 - Used by Pod::Simple
Pod::Simple 3.35 - Used by Test::Pod
Test::Pod 1.51 - Checks POD syntax
Test::Pod 1.52 - Checks POD syntax
Devel::Symdump 2.18 - Used by Pod::Coverage
File::Spec 3.63 - Used by Pod::Parser
File::Spec 3.75 - Used by Pod::Parser
Pod::Parser 1.63 - Used by Pod::Coverage
Pod::Coverage 0.23 - Used by Test::Pod::Coverage
Test::Pod::Coverage 1.10 - Tests POD coverage
threads 2.15 - Support for threads
threads 2.22 - Support for threads
threads::shared 1.55 - Support for sharing objects between threads
threads::shared 1.58 - Support for sharing objects between threads
Want 0.29 - :lvalue accessor support
Data::Dumper 2.161 - Object serialization support
Data::Dumper 2.172 - Object serialization support
Storable 2.56 - Object serialization support
Storable 3.11 - Object serialization support
Devel::StackTrace 2.02 - Used by Exception::Class
Devel::StackTrace 2.03 - Used by Exception::Class
Class::Data::Inheritable 0.08 - Used by Exception::Class
Exception::Class 1.42 - Error handling
Exception::Class 1.44 - Error handling
Object::InsideOut 4.04 - Inside-out object support
Object::InsideOut 4.05 - Inside-out object support
URI 1.71 - Used by LWP::UserAgent
URI 1.74 - Used by LWP::UserAgent
HTML::Tagset 3.20 - Used by LWP::UserAgent
HTML::Parser 3.72 - Used by LWP::UserAgent
LWP::UserAgent 6.21 - Used by Math::Random::MT::Auto
LWP::UserAgent 6.36 - Used by Math::Random::MT::Auto
Win32::API 0.82 - Used by Math::Random::MT::Auto (Win XP only)
Math::Random::MT::Auto 6.22 - Support for :SECURE mode
Math::Random::MT::Auto 6.23 - Support for :SECURE mode
=head1 DESCRIPTION
Expand Down
29 changes: 20 additions & 9 deletions lib/Object/InsideOut.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ require 5.006;

use strict;
use warnings;
use Config;

our $VERSION = '4.04';
our $VERSION = '4.05';
$VERSION = eval $VERSION;

use Object::InsideOut::Exception 4.04;
use Object::InsideOut::Util 4.04 qw(create_object hash_re is_it make_shared);
use Object::InsideOut::Metadata 4.04;
use Object::InsideOut::Exception 4.05;
use Object::InsideOut::Util 4.05 qw(create_object hash_re is_it make_shared);
use Object::InsideOut::Metadata 4.05;

require B;

Expand Down Expand Up @@ -99,7 +100,7 @@ if (! exists($GBL{'GBL_SET'})) {

share => { # Object sharing between threads
cl => {},
ok => $threads::shared::threads_shared,
ok => ($Config::Config{useithreads} && $threads::shared::threads_shared),
# obj # Tracks TIDs for shared objects
},

Expand All @@ -115,7 +116,10 @@ if (! exists($GBL{'GBL_SET'})) {
'heritage' => {'restricted' => 1},
};

if ($threads::shared::threads_shared && ($threads::shared::VERSION lt '0.96')) {
if ($Config::Config{useithreads} &&
$threads::shared::threads_shared &&
($threads::shared::VERSION lt '0.96'))
{
*threads::shared::is_shared = \&threads::shared::_id;
}
}
Expand Down Expand Up @@ -1233,7 +1237,8 @@ sub set_sharing :Sub(Private)
line => $line,
};
# Set up equality via overload
if ($sharing && $threads::shared::threads_shared
if ($sharing && $Config::Config{useithreads}
&& $threads::shared::threads_shared
&& $threads::shared::VERSION ge '0.95')
{
push(@{$GBL{'sub'}{'ol'}}, { 'pkg' => $class, 'ify' => 'EQUATE' });
Expand Down Expand Up @@ -1273,7 +1278,10 @@ sub CLONE
}

# Check for delayed threads::shared usage
if ($threads::shared::threads_shared && ! $GBL{'share'}{'ok'}) {
if ($Config::Config{useithreads} &&
$threads::shared::threads_shared &&
! $GBL{'share'}{'ok'})
{
OIO::Code->die(
'message' => q/'threads::shared' imported after Object::InsideOut initialized/,
'Info' => q/Add 'use threads::shared;' to the start of your application code/);
Expand Down Expand Up @@ -1942,7 +1950,10 @@ sub DESTROY
local($!, $^E, $?);

# Workaround for Perl's "in cleanup" bug
if ($threads::shared::threads_shared && ! $GBL{'term'}) {
if ($Config::Config{useithreads} &&
$threads::shared::threads_shared &&
! $GBL{'term'})
{
eval {
my $bug = keys(%{$GBL{'id'}{'obj'}})
+ keys(%{$GBL{'id'}{'reuse'}})
Expand Down
2 changes: 1 addition & 1 deletion lib/Object/InsideOut.pod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Object::InsideOut - Comprehensive inside-out object support module

=head1 VERSION

This document describes Object::InsideOut version 4.04
This document describes Object::InsideOut version 4.05

=head1 SYNOPSIS

Expand Down
2 changes: 1 addition & 1 deletion lib/Object/InsideOut/Autoload.pm
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ sub AUTOLOAD


# Ensure correct versioning
($Object::InsideOut::VERSION eq '4.04')
($Object::InsideOut::VERSION eq '4.05')
or die("Version mismatch\n");

# EOF
2 changes: 1 addition & 1 deletion lib/Object/InsideOut/Chained.pm
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ sub create_CHAINED :Sub(Private)


# Ensure correct versioning
($Object::InsideOut::VERSION eq '4.04')
($Object::InsideOut::VERSION eq '4.05')
or die("Version mismatch\n");

# EOF
8 changes: 4 additions & 4 deletions lib/Object/InsideOut/Cumulative.pm
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,11 @@ package Object::InsideOut::Results; {
use strict;
use warnings;

our $VERSION = '4.04';
our $VERSION = '4.05';
$VERSION = eval $VERSION;

use Object::InsideOut 4.04;
use Object::InsideOut::Metadata 4.04;
use Object::InsideOut 4.05;
use Object::InsideOut::Metadata 4.05;

my @VALUES :Field :Arg(VALUES);
my @CLASSES :Field :Arg(CLASSES);
Expand Down Expand Up @@ -260,7 +260,7 @@ add_meta('Object::InsideOut::Results', {


# Ensure correct versioning
($Object::InsideOut::VERSION eq '4.04')
($Object::InsideOut::VERSION eq '4.05')
or die("Version mismatch\n");

# EOF
2 changes: 1 addition & 1 deletion lib/Object/InsideOut/Dump.pm
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ sub dump


# Ensure correct versioning
($Object::InsideOut::VERSION eq '4.04')
($Object::InsideOut::VERSION eq '4.05')
or die("Version mismatch\n");

# EOF
2 changes: 1 addition & 1 deletion lib/Object/InsideOut/Dynamic.pm
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ sub create_field


# Ensure correct versioning
($Object::InsideOut::VERSION eq '4.04')
($Object::InsideOut::VERSION eq '4.05')
or die("Version mismatch\n");

# EOF
2 changes: 1 addition & 1 deletion lib/Object/InsideOut/Exception.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package Object::InsideOut::Exception; {
use strict;
use warnings;

our $VERSION = '4.04';
our $VERSION = '4.05';
$VERSION = eval $VERSION;

# Exceptions generated by this module
Expand Down
2 changes: 1 addition & 1 deletion lib/Object/InsideOut/Foreign.pm
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ sub inherit


# Ensure correct versioning
($Object::InsideOut::VERSION eq '4.04')
($Object::InsideOut::VERSION eq '4.05')
or die("Version mismatch\n");

# EOF
6 changes: 3 additions & 3 deletions lib/Object/InsideOut/Metadata.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package Object::InsideOut::Metadata; {
use strict;
use warnings;

our $VERSION = '4.04';
our $VERSION = '4.05';
$VERSION = eval $VERSION;

# Stores method metadata
Expand Down Expand Up @@ -99,7 +99,7 @@ __DATA__
### Object Interface ###
use Object::InsideOut 4.04;
use Object::InsideOut 4.05;
my @CLASSES :Field;
my @FOREIGN :Field;
Expand Down Expand Up @@ -268,7 +268,7 @@ Object::InsideOut::Metadata - Introspection for Object::InsideOut classes
=head1 VERSION
This document describes Object::InsideOut::Metadata version 4.04
This document describes Object::InsideOut::Metadata version 4.05
=head1 SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion lib/Object/InsideOut/Overload.pm
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ sub generate_OVERLOAD :Sub(Private)


# Ensure correct versioning
($Object::InsideOut::VERSION eq '4.04')
($Object::InsideOut::VERSION eq '4.05')
or die("Version mismatch\n");

# EOF
8 changes: 5 additions & 3 deletions lib/Object/InsideOut/Secure.pm
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
package Object::InsideOut::Secure; {
use strict;
use warnings;
use Config;

our $VERSION = '4.04';
our $VERSION = '4.05';
$VERSION = eval $VERSION;

use Object::InsideOut 4.04 ':hash_only';
use Object::InsideOut 4.05 ':hash_only';

# Holds used IDs
my %used :Field = ( 0 => undef );

# Our PRNG
BEGIN {
$Math::Random::MT::Auto::shared = $threads::shared::threads_shared;
$Math::Random::MT::Auto::shared = ($Config::Config{useithreads} &&
$threads::shared::threads_shared);
}
use Math::Random::MT::Auto 5.04 ':!auto';
my $prng = Math::Random::MT::Auto->new();
Expand Down
2 changes: 1 addition & 1 deletion lib/Object/InsideOut/Universal.pm
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ sub install_UNIVERSAL


# Ensure correct versioning
($Object::InsideOut::VERSION eq '4.04')
($Object::InsideOut::VERSION eq '4.05')
or die("Version mismatch\n");

# EOF
11 changes: 7 additions & 4 deletions lib/Object/InsideOut/Util.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ require 5.006;

use strict;
use warnings;
use Config;

our $VERSION = '4.04';
our $VERSION = '4.05';
$VERSION = eval $VERSION;

use Object::InsideOut::Metadata 4.04;
use Object::InsideOut::Metadata 4.05;

### Module Initialization ###

Expand All @@ -19,7 +20,7 @@ BEGIN {
}

# Import 'share' and 'bless' if threads::shared
if ($threads::shared::threads_shared) {
if ($Config::Config{useithreads} && $threads::shared::threads_shared) {
import threads::shared;
}
}
Expand Down Expand Up @@ -109,6 +110,7 @@ sub make_shared

# If not sharing or already thread-shared, then just return the input
if (! ref($in) ||
! $Config::Config{useithreads} ||
! $threads::threads ||
! $threads::shared::threads_shared ||
threads::shared::is_shared($in))
Expand Down Expand Up @@ -205,7 +207,8 @@ sub make_shared
# If thread-sharing, then make the copy thread-shared.
sub shared_copy
{
return (($threads::shared::threads_shared) ? clone_shared(@_) : clone(@_));
return (($Config::Config{useithreads} && $threads::shared::threads_shared)
? clone_shared(@_) : clone(@_));
}


Expand Down
2 changes: 1 addition & 1 deletion lib/Object/InsideOut/attributes.pm
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ sub FETCH_CODE_ATTRIBUTES :Sub { return (FETCH_ATTRS('CODE', @_)); }


# Ensure correct versioning
($Object::InsideOut::VERSION eq '4.04')
($Object::InsideOut::VERSION eq '4.05')
or die("Version mismatch\n");

# EOF
Loading

0 comments on commit db9e3a2

Please sign in to comment.