Subject: | [PATCH] threads.pm should not be a mandatory prerequisite |
--- Builder.pm.orig Sat Nov 13 17:09:58 2004
+++ Builder.pm Sat Nov 13 17:12:08 2004
@@ -16,15 +16,16 @@
# Make Test::Builder thread-safe for ithreads.
BEGIN {
use Config;
- if( $] >= 5.008 && $Config{useithreads} ) {
+ local $@;
+ ( $] >= 5.008 and $Config{useithreads} and eval {
require threads;
require threads::shared;
threads::shared->import;
- }
- else {
+ 1;
+ } ) or do {
*share = sub { 0 };
*lock = sub { 0 };
- }
+ };
}
use vars qw($Level);
--- Builder.pm.orig Sat Nov 13 17:09:58 2004
+++ Builder.pm Sat Nov 13 17:12:08 2004
@@ -16,15 +16,16 @@
# Make Test::Builder thread-safe for ithreads.
BEGIN {
use Config;
- if( $] >= 5.008 && $Config{useithreads} ) {
+ local $@;
+ ( $] >= 5.008 and $Config{useithreads} and eval {
require threads;
require threads::shared;
threads::shared->import;
- }
- else {
+ 1;
+ } ) or do {
*share = sub { 0 };
*lock = sub { 0 };
- }
+ };
}
use vars qw($Level);