r31884 - in /trunk/libforks-perl: ./ debian/ lib/ lib/forks/ lib/forks/shared/ lib/threads/shared/ t/

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Tue Mar 10 18:46:57 UTC 2009


Author: gregoa
Date: Tue Mar 10 18:46:54 2009
New Revision: 31884

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=31884
Log:
New upstream release.

Modified:
    trunk/libforks-perl/CHANGELOG
    trunk/libforks-perl/META.yml
    trunk/libforks-perl/README
    trunk/libforks-perl/SIGNATURE
    trunk/libforks-perl/TODO
    trunk/libforks-perl/debian/changelog
    trunk/libforks-perl/lib/forks.pm
    trunk/libforks-perl/lib/forks/shared.pm
    trunk/libforks-perl/lib/forks/shared/attributes.pm
    trunk/libforks-perl/lib/forks/shared/global_filter.pm
    trunk/libforks-perl/lib/forks/signals.pm
    trunk/libforks-perl/lib/threads/shared/array.pm
    trunk/libforks-perl/lib/threads/shared/handle.pm
    trunk/libforks-perl/lib/threads/shared/hash.pm
    trunk/libforks-perl/lib/threads/shared/scalar.pm
    trunk/libforks-perl/t/forks01.t
    trunk/libforks-perl/t/forks08.t

Modified: trunk/libforks-perl/CHANGELOG
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libforks-perl/CHANGELOG?rev=31884&op=diff
==============================================================================
--- trunk/libforks-perl/CHANGELOG (original)
+++ trunk/libforks-perl/CHANGELOG Tue Mar 10 18:46:54 2009
@@ -1,3 +1,20 @@
+0.30	February 16 2009
+	***** Bug fixes *****
+	
+	Don't overload/define Time::HiRes usleep or nanosleep unless they are supported
+	on target platform.
+	
+	Check for "Invalid value for shared scalar" errors when storing values in
+	shared scalars.
+	
+	Shared scalar values containing user tied objects will no longer be treated as
+	threads::shared objects when checking for circular references.
+	
+	***** Miscellaneous changes *****
+	
+	Overloaded sleep total sleep time is more accurate if interrupted by child
+	thread shutdown (CHLD) signals.
+	
 0.29	February 2 2009
 	***** Bug fixes *****
 	

Modified: trunk/libforks-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libforks-perl/META.yml?rev=31884&op=diff
==============================================================================
--- trunk/libforks-perl/META.yml (original)
+++ trunk/libforks-perl/META.yml Tue Mar 10 18:46:54 2009
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:                forks
-version:             0.29
+version:             0.30
 abstract:            forks - emulate threads with fork
 license:             ~
 author:              

Modified: trunk/libforks-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libforks-perl/README?rev=31884&op=diff
==============================================================================
--- trunk/libforks-perl/README (original)
+++ trunk/libforks-perl/README Tue Mar 10 18:46:54 2009
@@ -1,7 +1,7 @@
 README for forks
 
 Version:
- 0.29
+ 0.30
 
 The forks.pm module is a drop-in replacement for threads.pm.  It has the
 same syntax as the threads.pm module (it even takes over its namespace) but

Modified: trunk/libforks-perl/SIGNATURE
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libforks-perl/SIGNATURE?rev=31884&op=diff
==============================================================================
--- trunk/libforks-perl/SIGNATURE (original)
+++ trunk/libforks-perl/SIGNATURE Tue Mar 10 18:46:54 2009
@@ -14,42 +14,42 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-SHA1 d5ad35ce1e17d65b2c4a91b77cc78eeb70c5919b CHANGELOG
+SHA1 1986f939536e20f53051d5c5e5bdaf9024e381c1 CHANGELOG
 SHA1 455b7ebe2265a00e97f133c8cd7ebf56148a573d CREDITS
 SHA1 39698ae217c33cc989d0a1c32ef0adb147bc2dd7 MANIFEST
 SHA1 0a40de91b5f4169eef3ff3ef456a40b79d056e78 MANIFEST.skip
-SHA1 acfa02ecfd88c2527eea9b391d6125eea61bb356 META.yml
+SHA1 ba4020a229ec0d467dbd7b54a128e2f35f4f9332 META.yml
 SHA1 5bce1b4e0daf722ddeb831f80fec65ad41744aa1 Makefile.PL
-SHA1 8233abff1296faed2ab448145d313c3f9571fd99 README
-SHA1 28372f91a3aba521d78594d1fecb2f9a5b1184aa TODO
+SHA1 443bf24be6d1a041bc9c60ff12317f65d8c18ef7 README
+SHA1 7ece9940a98b966f12c8930024815fff293364e1 TODO
 SHA1 b8554457d862188bf4bce3639881d99617bc4529 VERSION
 SHA1 8b16e73ade400e5915771b8548b5a0649911f840 forks.xs
-SHA1 8e0fb5f8dfd61a6f5ee6cd3647b2787cd3dc8892 lib/forks.pm
-SHA1 2bf12c6333cc976cf6249718d3cd2989ee6ce194 lib/forks/shared.pm
-SHA1 0c922140d8c5aa6ee7494f346fcf5f4fd31820bb lib/forks/shared/attributes.pm
-SHA1 0abad40e1c6fa38163f8abbf0cdc51870f24b3eb lib/forks/shared/global_filter.pm
-SHA1 efb1d374de2acc4aa098ce79a1ed8f2204760b86 lib/forks/signals.pm
-SHA1 1f23abed6263fb48f06ae4bc40d2eb81be5f31f8 lib/threads/shared/array.pm
-SHA1 294f640a88002147f0515ab815d6711d03a65745 lib/threads/shared/handle.pm
-SHA1 0d36f39579263c42e3144914016832f17dd4642e lib/threads/shared/hash.pm
-SHA1 ffb7bfadeb908ce095fd7547bc87cb5630965cea lib/threads/shared/scalar.pm
+SHA1 0df068122f4bac9b1062a8eeaf39053dd4b7c7b1 lib/forks.pm
+SHA1 85f5fd1b488b2c6ed314ed8940172f62c6ac5fd6 lib/forks/shared.pm
+SHA1 ab4b5f6d63c02828e0dec2193a70fe0a1e81bd48 lib/forks/shared/attributes.pm
+SHA1 9068e217c50d505285622eb2727e94dd92ac94fd lib/forks/shared/global_filter.pm
+SHA1 0ba67bd6674097deec8d239e363dfb0f23666c2d lib/forks/signals.pm
+SHA1 28149b490859601760ea45fd341d0f287dec7d9a lib/threads/shared/array.pm
+SHA1 6d2cf0bde23851e184922893531abd6aa1b5add6 lib/threads/shared/handle.pm
+SHA1 71cb019235efa5744936bd7ffbc99f85fdf0c2c8 lib/threads/shared/hash.pm
+SHA1 1e256aa82c1b3676be438d3bb1bd8eae979a2543 lib/threads/shared/scalar.pm
 SHA1 f69eeb8e326e003853e4ccec4960884a8b7e56dd ppport.h
 SHA1 e0b161c71a2dba88fa7827c54ab597bf29ba2cdb t/forks00-sigtrap.t
-SHA1 3416fd23b933fa5ea16bc04f1d76b38206e3acb9 t/forks01.t
+SHA1 ee99daa214de31482de760ff70419a6ed0590e24 t/forks01.t
 SHA1 dc739710ac9c97c36f8e2cb77ae5af4aee2e8447 t/forks02.t
 SHA1 0f74478dda08dbd57a29bb46ef5a95cdf6d864eb t/forks03.t
 SHA1 2863b14f575b3415ac7b415ad77a8a7ed5cb9143 t/forks04.t
 SHA1 6a169e8599e1d75b5f7ad1ac8209f9eae46b258b t/forks05.t
 SHA1 50af07b5275498fd708b4fb2d0de5e28062b33fd t/forks06.t
 SHA1 f8dd4f7c16f7ce96cde23f1953737468fa6bad7f t/forks07.t
-SHA1 3f9ea719406830705a137f5ba37eec45f31a0b81 t/forks08.t
+SHA1 8123b2da0db17630c77bdffac33eb53dc28a8bf2 t/forks08.t
 SHA1 686e3f8214ba69d3960218aa6eb2a49b5c0a2270 t/forks09.t
 SHA1 d45ee162070db10b691958fa140d8fc297bd3d90 t/forks20.t
 SHA1 fc5734f9c393dcc9f12c87df4bf9362e88a800ad t/forks99.t
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.8 (Darwin)
 
-iEYEARECAAYFAkmH5AsACgkQQwn7DcpJEO59ogCgsuMiyj/sXjP4Rxz5cErgtbDV
-6TMAnRJnU6IsSbk7dQgbcrkt8CYb7yOQ
-=hQEB
+iEYEARECAAYFAkmacPsACgkQQwn7DcpJEO59tQCfa5Hr7UMjRR7QpktcH6HykKAk
+F64AoNcmQXAiF1uga7iDU6ItKudMCTUd
+=EXKk
 -----END PGP SIGNATURE-----

Modified: trunk/libforks-perl/TODO
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libforks-perl/TODO?rev=31884&op=diff
==============================================================================
--- trunk/libforks-perl/TODO (original)
+++ trunk/libforks-perl/TODO Tue Mar 10 18:46:54 2009
@@ -90,10 +90,6 @@
 
 
 ***** Miscellaneous Items *****
-
-sleep() can sleep too long if woken by many forks-related signals (mainly CHLD).
-Would be more precise if sleep time could be tracked as floating point rather
-than integer, like hi-res versions of the function.
 
 Consider checking _check_pl_signal_unsafe_flag for any thread signaling behavior,
 and warn user about (or prevent from using) signals (i.e. deadlock detect, $t->kill).

Modified: trunk/libforks-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libforks-perl/debian/changelog?rev=31884&op=diff
==============================================================================
--- trunk/libforks-perl/debian/changelog (original)
+++ trunk/libforks-perl/debian/changelog Tue Mar 10 18:46:54 2009
@@ -1,3 +1,9 @@
+libforks-perl (0.30-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+
+ -- gregor herrmann <gregoa at debian.org>  Tue, 10 Mar 2009 19:45:46 +0100
+
 libforks-perl (0.29-1) unstable; urgency=low
 
   * Initial Release. (Closes: #514058)

Modified: trunk/libforks-perl/lib/forks.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libforks-perl/lib/forks.pm?rev=31884&op=diff
==============================================================================
--- trunk/libforks-perl/lib/forks.pm (original)
+++ trunk/libforks-perl/lib/forks.pm Tue Mar 10 18:46:54 2009
@@ -1,5 +1,5 @@
 package forks;   # make sure CPAN picks up on forks.pm
-$VERSION = '0.29';
+$VERSION = '0.30';
 
 # Allow external modules to defer shared variable init at require
 
@@ -583,15 +583,16 @@
         while ($s - $t > 0) {
             $s -= $t;
             $IFNDEF_REAPER_CALLED = 0;
-            $f += $t = CORE::sleep $s;
+            $f += $t = $sleep->($s);
             last unless $IFNDEF_REAPER_CALLED;
         }
-        return $f; 
+        return sprintf("%.0f", $f); 
     };
     Scalar::Util::set_prototype(\&{$sub}, $proto);
     *CORE::GLOBAL::sleep = *CORE::GLOBAL::sleep = $sub;
 
-# Generate same function wrapper for Time::HiRes sleep, usleep, and nanosleep
+# Generate same function wrapper for Time::HiRes sleep, usleep, and nanosleep.
+# For usleep and nanosleep, only overload if they are defined.
 
     $proto = prototype 'Time::HiRes::sleep';
     $sub = sub {
@@ -611,43 +612,47 @@
     Scalar::Util::set_prototype(\&{$sub}, $proto);
     *Time::HiRes::sleep = *Time::HiRes::sleep = $sub;
 
-    $proto = prototype 'Time::HiRes::usleep';
-    my $usleep = \&Time::HiRes::usleep;
-    $sub = sub {
-        my $s = shift;
-        my $t = 0;
-        my $f = 0;
-        my $sig;
-        local $IFNDEF_REAPER_CALLED;
-        while ($s - $t > 0) {
-            $s -= $t;
-            $IFNDEF_REAPER_CALLED = 0;
-            $f += $t = $usleep->($s);
-            last unless $IFNDEF_REAPER_CALLED;
-        }
-        return $f; 
-    };
-    Scalar::Util::set_prototype(\&{$sub}, $proto);
-    *Time::HiRes::usleep = *Time::HiRes::usleep = $sub;
-
-    $proto = prototype 'Time::HiRes::nanosleep';
-    my $nanosleep = \&Time::HiRes::nanosleep;
-    $sub = sub {
-        my $s = shift;
-        my $t = 0;
-        my $f = 0;
-        my $sig;
-        local $IFNDEF_REAPER_CALLED;
-        while ($s - $t > 0) {
-            $s -= $t;
-            $IFNDEF_REAPER_CALLED = 0;
-            $f += $t = $nanosleep->($s);
-            last unless $IFNDEF_REAPER_CALLED;
-        }
-        return $f; 
-    };
-    Scalar::Util::set_prototype(\&{$sub}, $proto);
-    *Time::HiRes::nanosleep = *Time::HiRes::nanosleep = $sub;
+    if (&Time::HiRes::d_usleep) {
+        $proto = prototype 'Time::HiRes::usleep';
+        my $usleep = \&Time::HiRes::usleep;
+        $sub = sub {
+            my $s = shift;
+            my $t = 0;
+            my $f = 0;
+            my $sig;
+            local $IFNDEF_REAPER_CALLED;
+            while ($s - $t > 0) {
+                $s -= $t;
+                $IFNDEF_REAPER_CALLED = 0;
+                $f += $t = $usleep->($s);
+                last unless $IFNDEF_REAPER_CALLED;
+            }
+            return $f; 
+        };
+        Scalar::Util::set_prototype(\&{$sub}, $proto);
+        *Time::HiRes::usleep = *Time::HiRes::usleep = $sub;
+    }
+
+    if (&Time::HiRes::d_nanosleep) {
+        $proto = prototype 'Time::HiRes::nanosleep';
+        my $nanosleep = \&Time::HiRes::nanosleep;
+        $sub = sub {
+            my $s = shift;
+            my $t = 0;
+            my $f = 0;
+            my $sig;
+            local $IFNDEF_REAPER_CALLED;
+            while ($s - $t > 0) {
+                $s -= $t;
+                $IFNDEF_REAPER_CALLED = 0;
+                $f += $t = $nanosleep->($s);
+                last unless $IFNDEF_REAPER_CALLED;
+            }
+            return $f; 
+        };
+        Scalar::Util::set_prototype(\&{$sub}, $proto);
+        *Time::HiRes::nanosleep = *Time::HiRes::nanosleep = $sub;
+    }
 } #BEGIN
 
 # Satisfy -require-
@@ -3722,7 +3727,7 @@
 
 =head1 VERSION
 
-This documentation describes version 0.29.
+This documentation describes version 0.30.
 
 =head1 SYNOPSIS
 
@@ -4249,7 +4254,7 @@
 =head1 COPYRIGHT
 
 Copyright (c)
- 2005-2008 Eric Rybski <rybskej at yahoo.com>,
+ 2005-2009 Eric Rybski <rybskej at yahoo.com>,
  2002-2004 Elizabeth Mattijsen <liz at dijkmat.nl>.
 All rights reserved.  This program is free software; you can redistribute it
 and/or modify it under the same terms as Perl itself.

Modified: trunk/libforks-perl/lib/forks/shared.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libforks-perl/lib/forks/shared.pm?rev=31884&op=diff
==============================================================================
--- trunk/libforks-perl/lib/forks/shared.pm (original)
+++ trunk/libforks-perl/lib/forks/shared.pm Tue Mar 10 18:46:54 2009
@@ -1,5 +1,5 @@
 package forks::shared;    # make sure CPAN picks up on forks::shared.pm
-$VERSION = '0.29';
+$VERSION = '0.30';
 
 use Config ();
 
@@ -360,10 +360,10 @@
 # Increment the current clone value (mark this as a cloned version)
 
 sub CLONE {
-	%CIRCULAR = ();
-	%CIRCULAR_REVERSE = ();
-	%SHARED_CACHE = ();
-	$CLONE++;
+    %CIRCULAR = ();
+    %CIRCULAR_REVERSE = ();
+    %SHARED_CACHE = ();
+    $CLONE++;
 } #CLONE
 
 #---------------------------------------------------------------------------
@@ -417,7 +417,7 @@
     return $it unless $ref;
 
 # Obtain the object
-#  Return immediately if isn't a threads::shared object (i.e. circular REF)
+# Return immediately if isn't a threads::shared object (i.e. circular REF)
 
     my $object;
     if ($ref eq 'SCALAR') {
@@ -429,8 +429,9 @@
     } elsif ($ref eq 'GLOB') {
         $object = tied *{$it};
     } else {
-    	return $it;
-    }
+        return $it;
+    }
+    return $it unless UNIVERSAL::isa($object, 'threads::shared');
 
 #  Get the ordinal
 #  If we already have a cached copy of this object
@@ -441,15 +442,15 @@
 #   Cache this value
 # Return the (tied) value
 
-	my $ordinal = $object->{'ordinal'};
-	if (exists $SHARED_CACHE{$ordinal}) {
-		my $class = blessed($it);
-		CORE::bless($SHARED_CACHE{$ordinal}, $class) if $class;
-		$it = $SHARED_CACHE{$ordinal};
-	} else {
-		$SHARED_CACHE{$ordinal} = $it;
-	}
-	return $it;
+    my $ordinal = $object->{'ordinal'};
+    if (exists $SHARED_CACHE{$ordinal}) {
+        my $class = blessed($it);
+        CORE::bless($SHARED_CACHE{$ordinal}, $class) if $class;
+        $it = $SHARED_CACHE{$ordinal};
+    } else {
+        $SHARED_CACHE{$ordinal} = $it;
+    }
+    return $it;
 }
 
 # Define generic perltie proxy methods for most scalar, array, hash, and handle events
@@ -545,19 +546,22 @@
 
     my $self = shift;
     my $sub = $self->{'module'}.'::STORE';
-    if (my $ref = reftype($_[1])) {
+    my $val = $_[$self->{'type'} eq 'scalar' ? 0 : 1];
+    if (my $ref = reftype($val)) {
         my $object;
         if ($ref eq 'SCALAR') {
-            $object = tied ${$_[1]};
+            $object = tied ${$val};
         } elsif ($ref eq 'ARRAY') {
-            $object = tied @{$_[1]};
+            $object = tied @{$val};
         } elsif ($ref eq 'HASH') {
-            $object = tied %{$_[1]};
+            $object = tied %{$val};
         } elsif ($ref eq 'GLOB') {
-            $object = tied *{$_[1]};
+            $object = tied *{$val};
+        } elsif ($ref eq 'REF') {
+            $object = $val;
         }
         Carp::croak "Invalid value for shared scalar"
-            unless defined $object && $object->isa('threads::shared');
+            unless defined $object && (ref($object) eq 'REF' || $object->isa('threads::shared'));
     }
 
 # If we're a hash and the key is a code reference
@@ -796,7 +800,12 @@
     } else {
         return undef;
     }
-} #_id
+} #__id
+
+#---------------------------------------------------------------------------
+#  IN: 1 reference to variable
+
+sub _refcnt {} #_refcnt
 
 #---------------------------------------------------------------------------
 #  IN: 1..N ordinal numbers of variables to unlock
@@ -1157,7 +1166,7 @@
 =head1 COPYRIGHT
 
 Copyright (c)
- 2005-2008 Eric Rybski <rybskej at yahoo.com>,
+ 2005-2009 Eric Rybski <rybskej at yahoo.com>,
  2002-2004 Elizabeth Mattijsen <liz at dijkmat.nl>.
 All rights reserved.  This program is free software; you can redistribute it
 and/or modify it under the same terms as Perl itself.

Modified: trunk/libforks-perl/lib/forks/shared/attributes.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libforks-perl/lib/forks/shared/attributes.pm?rev=31884&op=diff
==============================================================================
--- trunk/libforks-perl/lib/forks/shared/attributes.pm (original)
+++ trunk/libforks-perl/lib/forks/shared/attributes.pm Tue Mar 10 18:46:54 2009
@@ -1,6 +1,6 @@
 package
     forks::shared::attributes; #hide from PAUSE
-$VERSION = '0.29';
+$VERSION = '0.30';
 
 use Attribute::Handlers;
 

Modified: trunk/libforks-perl/lib/forks/shared/global_filter.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libforks-perl/lib/forks/shared/global_filter.pm?rev=31884&op=diff
==============================================================================
--- trunk/libforks-perl/lib/forks/shared/global_filter.pm (original)
+++ trunk/libforks-perl/lib/forks/shared/global_filter.pm Tue Mar 10 18:46:54 2009
@@ -10,7 +10,7 @@
 use List::MoreUtils;
 
 use vars '$VERSION';
-$VERSION = '0.29';
+$VERSION = '0.30';
 
 our @FILTER = ();
 my @_dummy = (*ARGVOUT);

Modified: trunk/libforks-perl/lib/forks/signals.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libforks-perl/lib/forks/signals.pm?rev=31884&op=diff
==============================================================================
--- trunk/libforks-perl/lib/forks/signals.pm (original)
+++ trunk/libforks-perl/lib/forks/signals.pm Tue Mar 10 18:46:54 2009
@@ -1,6 +1,6 @@
 package
     forks::signals; #hide from PAUSE
-$VERSION = '0.29';
+$VERSION = '0.30';
 
 use strict;
 use warnings;
@@ -177,7 +177,7 @@
 =head1 COPYRIGHT
 
 Copyright (c)
- 2005-2008 Eric Rybski <rybskej at yahoo.com>.
+ 2005-2009 Eric Rybski <rybskej at yahoo.com>.
 All rights reserved.  This program is free software; you can redistribute it
 and/or modify it under the same terms as Perl itself.
 

Modified: trunk/libforks-perl/lib/threads/shared/array.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libforks-perl/lib/threads/shared/array.pm?rev=31884&op=diff
==============================================================================
--- trunk/libforks-perl/lib/threads/shared/array.pm (original)
+++ trunk/libforks-perl/lib/threads/shared/array.pm Tue Mar 10 18:46:54 2009
@@ -3,7 +3,7 @@
 # Make sure we have version info for this module
 # Make sure we do everything by the book from now on
 
-$VERSION = '0.29';
+$VERSION = '0.30';
 use strict;
 use Scalar::Util;
 
@@ -145,7 +145,7 @@
 =head1 COPYRIGHT
 
 Copyright (c)
- 2005-2008 Eric Rybski <rybskej at yahoo.com>,
+ 2005-2009 Eric Rybski <rybskej at yahoo.com>,
  2002-2004 Elizabeth Mattijsen <liz at dijkmat.nl>.
 All rights reserved.  This program is free software; you can redistribute it
 and/or modify it under the same terms as Perl itself.

Modified: trunk/libforks-perl/lib/threads/shared/handle.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libforks-perl/lib/threads/shared/handle.pm?rev=31884&op=diff
==============================================================================
--- trunk/libforks-perl/lib/threads/shared/handle.pm (original)
+++ trunk/libforks-perl/lib/threads/shared/handle.pm Tue Mar 10 18:46:54 2009
@@ -3,7 +3,7 @@
 # Make sure we have version info for this module
 # Make sure we do everything by the book from now on
 
-$VERSION = '0.29';
+$VERSION = '0.30';
 use strict;
 
 # Satisfy -require-
@@ -175,7 +175,7 @@
 =head1 COPYRIGHT
 
 Copyright (c)
- 2005-2008 Eric Rybski <rybskej at yahoo.com>,
+ 2005-2009 Eric Rybski <rybskej at yahoo.com>,
  2002-2004 Elizabeth Mattijsen <liz at dijkmat.nl>.
 All rights reserved.  This program is free software; you can redistribute it
 and/or modify it under the same terms as Perl itself.

Modified: trunk/libforks-perl/lib/threads/shared/hash.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libforks-perl/lib/threads/shared/hash.pm?rev=31884&op=diff
==============================================================================
--- trunk/libforks-perl/lib/threads/shared/hash.pm (original)
+++ trunk/libforks-perl/lib/threads/shared/hash.pm Tue Mar 10 18:46:54 2009
@@ -3,7 +3,7 @@
 # Make sure we have version info for this module
 # Make sure we do everything by the book from now on
 
-$VERSION = '0.29';
+$VERSION = '0.30';
 use strict;
 use Scalar::Util;
 
@@ -102,7 +102,7 @@
 =head1 COPYRIGHT
 
 Copyright (c)
- 2005-2008 Eric Rybski <rybskej at yahoo.com>,
+ 2005-2009 Eric Rybski <rybskej at yahoo.com>,
  2002-2004 Elizabeth Mattijsen <liz at dijkmat.nl>.
 All rights reserved.  This program is free software; you can redistribute it
 and/or modify it under the same terms as Perl itself.

Modified: trunk/libforks-perl/lib/threads/shared/scalar.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libforks-perl/lib/threads/shared/scalar.pm?rev=31884&op=diff
==============================================================================
--- trunk/libforks-perl/lib/threads/shared/scalar.pm (original)
+++ trunk/libforks-perl/lib/threads/shared/scalar.pm Tue Mar 10 18:46:54 2009
@@ -3,7 +3,7 @@
 # Make sure we have version info for this module
 # Make sure we do everything by the book from now on
 
-$VERSION = '0.29';
+$VERSION = '0.30';
 use strict;
 use Scalar::Util;
 
@@ -69,7 +69,7 @@
 =head1 COPYRIGHT
 
 Copyright (c)
- 2005-2008 Eric Rybski <rybskej at yahoo.com>,
+ 2005-2009 Eric Rybski <rybskej at yahoo.com>,
  2002-2004 Elizabeth Mattijsen <liz at dijkmat.nl>.
 All rights reserved.  This program is free software; you can redistribute it
 and/or modify it under the same terms as Perl itself.

Modified: trunk/libforks-perl/t/forks01.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libforks-perl/t/forks01.t?rev=31884&op=diff
==============================================================================
--- trunk/libforks-perl/t/forks01.t (original)
+++ trunk/libforks-perl/t/forks01.t Tue Mar 10 18:46:54 2009
@@ -533,20 +533,22 @@
 
 #== thread stack size ==============================================
 cmp_ok( threads->get_stack_size(), '==', 0, "Check for default thread stack size" );
-SKIP: {
-    skip 'Not implemented (yet)', 5;
+{
     threads->set_stack_size( 64*4096 );
     cmp_ok( threads->get_stack_size(), '>', 0, "Check for custom thread stack size" );
-    $thread1 = threads->new( sub { 1 })->join();
+    $thread1 = threads->new( sub { 1 });
     cmp_ok( $thread1->get_stack_size(), '>', 0, "Check for custom thread stack size" );
+    $thread1->join();
 
     threads->set_stack_size( 0 );
     cmp_ok( threads->get_stack_size(), '==', 0, "Check for default thread stack size" );
-    $thread1 = threads->new({ 'stack_size' => 4096*64 }, sub { 1 })->join();
+    $thread1 = threads->new({ 'stack' => 4096*64 }, sub { 1 });
     cmp_ok( $thread1->get_stack_size(), '>', 0, "Check for custom thread stack size" );
 
-    $thread2 = $thread1->create( sub { 1 } )->join();
-    cmp_ok( $thread1->get_stack_size(), '>', 0, "Check for custom thread stack size" );
+    $thread2 = $thread1->create( sub { 1 } );
+    cmp_ok( $thread2->get_stack_size(), '==', 0, "Check for default stack size" );
+    $thread1->join();
+    $thread2->join();
 }
 
 #== thread context =================================================

Modified: trunk/libforks-perl/t/forks08.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libforks-perl/t/forks08.t?rev=31884&op=diff
==============================================================================
--- trunk/libforks-perl/t/forks08.t (original)
+++ trunk/libforks-perl/t/forks08.t Tue Mar 10 18:46:54 2009
@@ -58,26 +58,31 @@
 my $t1 = threads->new(sub { sleep 1; });
 my $time = sleep 5;
 $t1->join();
-cmp_ok($time, '==', 5,'check that main thread sleeps full 5 seconds after CHLD signal');
+cmp_ok(sprintf("%.0f", $time), '==', 5,'check that main thread sleeps full 5 seconds after CHLD signal');
 
 # Check that main thread waits full 5 seconds after CHLD signal
 $t1 = threads->new(sub { sleep 1; });
 $time = Time::HiRes::sleep 5;
 $t1->join();
-cmp_ok(sprintf("%.0f", $time), '>=', 5,'check that main thread sleeps full 5 seconds after CHLD signal');
+cmp_ok(sprintf("%.0f", $time), '==', 5,'check that main thread sleeps full 5 seconds after CHLD signal');
 
 # Check that main thread waits full 5 seconds after CHLD signal
-$t1 = threads->new(sub { sleep 1; });
-$time = Time::HiRes::usleep 5000000;
-$t1->join();
-cmp_ok(sprintf("%.0f", $time / 6), '>=', 5,'check that main thread sleeps full 5 seconds after CHLD signal');
+SKIP: {
+	skip('usleep not supported on this platform',1) unless &Time::HiRes::d_usleep;
+	$t1 = threads->new(sub { sleep 1; });
+	$time = Time::HiRes::usleep 5000000;
+	$t1->join();
+	cmp_ok(sprintf("%.0f", $time / 10**6), '==', 5,'check that main thread sleeps full 5 seconds after CHLD signal');
+}
 
 # Check that main thread waits full 5 seconds after CHLD signal
-$t1 = threads->new(sub { sleep 1; });
-$time = Time::HiRes::nanosleep 5000000000;
-$t1->join();
-cmp_ok(sprintf("%.0f", ($time / 9)), '>=', 5,'check that main thread sleeps full 5 seconds after CHLD signal');
-
+SKIP: {
+	skip('nanosleep not supported on this platform',1) unless &Time::HiRes::d_nanosleep;
+	$t1 = threads->new(sub { sleep 1; });
+	$time = Time::HiRes::nanosleep 5000000000;
+	$t1->join();
+	cmp_ok(sprintf("%.0f", ($time / 10**9)), '==', 5,'check that main thread sleeps full 5 seconds after CHLD signal');
+}
 
 # Check that main thread waits full 5 seconds after CHLD signal
 my $cnt = 0;
@@ -85,7 +90,7 @@
 $t1 = threads->new(sub { sleep 1; });
 $time = sleep 5;
 $t1->join();
-cmp_ok(sprintf("%.0f", $time), '>=', 5,'check that main thread sleeps full 5 seconds after custom CHLD signal');
+cmp_ok(sprintf("%.0f", $time), '==', 5,'check that main thread sleeps full 5 seconds after custom CHLD signal');
 cmp_ok($cnt, '>=', 1,'check that custom CHLD signal was called');
 
 1;




More information about the Pkg-perl-cvs-commits mailing list