a spelling nit
[p5sagit/p5-mst-13.2.git] / ext / threads / threads.pm
index 8f2d1be..6d47380 100755 (executable)
@@ -5,7 +5,7 @@ use 5.008;
 use strict;
 use warnings;
 
-our $VERSION = '1.63';
+our $VERSION = '1.65';
 my $XS_VERSION = $VERSION;
 $VERSION = eval $VERSION;
 
@@ -134,7 +134,7 @@ threads - Perl interpreter-based threads
 
 =head1 VERSION
 
-This document describes threads version 1.63
+This document describes threads version 1.65
 
 =head1 SYNOPSIS
 
@@ -859,16 +859,16 @@ problem.
 
 =over
 
-=item Threadsafe modules
+=item Thread-safe modules
 
 See L<perlmod/"Making your module threadsafe"> when creating modules that may
 be used in threaded applications, especially if those modules use non-Perl
 data, or XS code.
 
-=item Using non-threadsafe modules
+=item Using non-thread-safe modules
 
-Unfortunately, you may encounter Perl modules that are not I<threadsafe>.  For
-example, they may crash the Perl interpreter during execution, or may dump
+Unfortunately, you may encounter Perl modules that are not I<thread-safe>.
+For example, they may crash the Perl interpreter during execution, or may dump
 core on termination.  Depending on the module and the requirements of your
 application, it may be possible to work around such difficulties.
 
@@ -879,19 +879,43 @@ C<import> if needed):
     sub thr_func
     {
         require Unsafe::Module
-        # import Unsafe::Module ...;
+        # Unsafe::Module->import(...);
 
         ....
     }
 
 If the module is needed inside the I<main> thread, try modifying your
 application so that the module is loaded (again using C<require> and
-C<import>) after any threads are started, and in such a way that no other
-threads are started afterwards.
+C<-E<gt>import()>) after any threads are started, and in such a way that no
+other threads are started afterwards.
 
 If the above does not work, or is not adequate for your application, then file
 a bug report on L<http://rt.cpan.org/Public/> against the problematic module.
 
+=item Current working directory
+
+On all platforms except MSWin32, the setting for the current working directory
+is shared among all threads such that changing it in one thread (e.g., using
+C<chdir()>) will affect all the threads in the application.
+
+On MSWin32, each thread maintains its own the current working directory
+setting.
+
+=item Environment variables
+
+Currently, on all platforms except MSWin32, all I<system> calls (e.g., using
+C<system()> or back-ticks) made from threads use the environment variable
+settings from the I<main> thread.  In other words, changes made to C<%ENV> in
+a thread will not be visible in I<system> calls made by that thread.
+
+To work around this, set environment variables as part of the I<system> call.
+For example:
+
+    my $msg = 'hello';
+    system("FOO=$msg; echo \$FOO");   # Outputs 'hello' to STDOUT
+
+On MSWin32, each thread maintains its own set of environment variables.
+
 =item Parent-child threads
 
 On some platforms, it might not be possible to destroy I<parent> threads while
@@ -944,12 +968,12 @@ reconstituting it in the joining thread.
 =item Perl Bugs and the CPAN Version of L<threads>
 
 Support for threads extends beyond the code in this module (i.e.,
-F<threads.pm> and F<threads.xs>), and into the Perl iterpreter itself.  Older
+F<threads.pm> and F<threads.xs>), and into the Perl interpreter itself.  Older
 versions of Perl contain bugs that may manifest themselves despite using the
 latest version of L<threads> from CPAN.  There is no workaround for this other
-than upgrading to the lastest version of Perl.
+than upgrading to the latest version of Perl.
 
-Even with the lastest version of Perl, it is known that certain constructs
+Even with the latest version of Perl, it is known that certain constructs
 with threads may result in warning messages concerning leaked scalars or
 unreferenced scalars.  However, such warnings are harmless, and may safely be
 ignored.
@@ -966,7 +990,7 @@ L<threads> Discussion Forum on CPAN:
 L<http://www.cpanforum.com/dist/threads>
 
 Annotated POD for L<threads>:
-L<http://annocpan.org/~JDHEDDEN/threads-1.63/threads.pm>
+L<http://annocpan.org/~JDHEDDEN/threads-1.65/threads.pm>
 
 Source repository:
 L<http://code.google.com/p/threads-shared/>