Skip to content

Commit

Permalink
Merge pull request #1 from jdhedden/develop
Browse files Browse the repository at this point in the history
Non-threaded Perl
  • Loading branch information
jdhedden committed Nov 27, 2018
2 parents 826ebcc + 9b65481 commit d9c9049
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 11 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ nytprof.out
*.o
*.bs
/_eumm/

/ARCHIVE/
/stuff/
/Notes.txt
6 changes: 6 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
Revision history for Perl extension Math::Random::MT::Auto.

-
-

6.23 Tue Nov 27 03:12:07 2018
- Fix for non-threaded Perl (rt.cpan.org #127809)

6.22 Tue Sep 4 14:06:20 2012
- Enhancement to shuffle() to return an array

Expand Down
2 changes: 0 additions & 2 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,3 @@ examples/erlang.pl
examples/poisson.pl
examples/binomial.pl
examples/cards.pl
META.yml Module YAML meta-data (added by MakeMaker)
META.json Module JSON meta-data (added by MakeMaker)
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Math-Random-MT-Auto version 6.22
Math-Random-MT-Auto version 6.23
================================

This module provides pseudorandom number generators (PRNGs) that are based
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Math-Random-MT-Auto
The 'Math-Random-MT-Auto' module for Perl.
Pseudo-random number generators for Perl based on the Mersenne Twister algorithm.

Detailed information regarding this module can be found on [MetaCPAN](https://metacpan.org/pod/Math::Random::MT::Auto).

18 changes: 13 additions & 5 deletions lib/Math/Random/MT/Auto.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ require 5.006;
use strict;
use warnings;

our $VERSION = '6.22';
our $VERSION = '6.23';
my $XS_VERSION = $VERSION;
$VERSION = eval $VERSION;

Expand Down Expand Up @@ -644,7 +644,10 @@ sub _seed_prng :PRIVATE

my $seed = $seed_for{$$prng}; # Get the seed for the PRNG

if ($threads::shared::threads_shared && threads::shared::_id($seed)) {
if ($Config::Config{'useithreads'} &&
$threads::shared::threads_shared &&
threads::shared::_id($seed))
{
# If the seed is thread-shared, then must make a non-shared copy to
# send to the PRNG
my @seed = @{$seed};
Expand All @@ -668,7 +671,7 @@ Math::Random::MT::Auto - Auto-seeded Mersenne Twister PRNGs
=head1 VERSION
This documentation refers to Math::Random::MT::Auto version 6.22
This documentation refers to Math::Random::MT::Auto version 6.23
=head1 SYNOPSIS
Expand Down Expand Up @@ -1712,8 +1715,13 @@ L<http://rt.cpan.org/Public/Dist/Display.html?Name=Math-Random-MT-Auto>
=head1 SEE ALSO
Math::Random::MT::Auto Discussion Forum on CPAN:
L<http://www.cpanforum.com/dist/Math-Random-MT-Auto>
Math::Random::MT::Auto on MetaCPAN:
L<https://metacpan.org/release/Math-Random-MT-Auto>
Code repository:
L<https://github.com/jdhedden/Math-Random-MT-Auto>
Sample code in the I<examples> directory of this distribution on CPAN.
The Mersenne Twister is the (current) quintessential pseudorandom number
generator. It is fast, and has a period of 2^19937 - 1. The Mersenne
Expand Down
2 changes: 1 addition & 1 deletion lib/Math/Random/MT/Auto/Range.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package Math::Random::MT::Auto::Range; {
use strict;
use warnings;

our $VERSION = '6.22';
our $VERSION = '6.23';
$VERSION = eval $VERSION;

use Scalar::Util 1.18;
Expand Down
4 changes: 3 additions & 1 deletion t/99-pod.t
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ SKIP: {
}
set_spell_cmd('aspell list --lang=en');
add_stopwords(<DATA>);
pod_file_spelling_ok('lib/Math/Random/MT/Auto.pm', 'MRAM POD spelling');
pod_file_spelling_ok('lib/Math/Random/MT/Auto.pm', 'MRMA POD spelling');
pod_file_spelling_ok('lib/Math/Random/MT/Auto/Range.pm', 'MRMA::Range POD spelling');
unlink("/home/$ENV{'USER'}/en.prepl", "/home/$ENV{'USER'}/en.pws");
}
Expand All @@ -67,6 +67,7 @@ __DATA__
Cokus's
FreeBSD
Hedden
Cokus
HotBits
MSWin32
Makoto
Expand Down Expand Up @@ -107,4 +108,5 @@ Arg
PRNG's
subclasses
MetaCPAN
__END__

0 comments on commit d9c9049

Please sign in to comment.