The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Devel::ThreadsForks - check for availability of threads or forks

VERSION

This documentation describes version 0.08.

SYNOPSIS

 # before
 BEGIN { eval "use Devel::ThreadsForks" }

 # after
 BEGIN { eval "use Devel::ThreadsForks; 1" or do "threadsforks" }
 # "threadsforks" written and added to MANIFEST

DESCRIPTION

The Devel::ThreadsForks module only serves a purpose in the development environment of an author of a CPAN distribution (or more precisely: a user of the ExtUtils::MakeMaker module). It only needs to be installed on the development environment of an author of a CPAN distribution.

There are basically three situations in which this module can get called.

INITIAL RUN BY DEVELOPER

If the developer has Devel::ThreadsForks installed, and adds the line:

 BEGIN { eval "use Devel::ThreadsForks" }

at the start of the Makefile.PL, then running the Makefile.PL will create a file called "threadsforks" in the current directory. This file is intended to be called with a do. It performs the actual check whether the threads can run, or whether the forks module has been installed in case it is running on an unthreaded Perl.

It will also adapt the code in the Makefile.PL itself by changing it to:

 BEGIN { eval "use Devel::ThreadsForks; 1" || do 'threadsforks' }

Finally, it will adapt the MANIFEST by adding the line:

 threadsforks                threads/forks test (Added by Devel::ThreadsForks)

This will cause the check file to be included in any distribution made for that Makefile.PL.

LATER RUNS BY DEVELOPER

Any subsequent loading of this module, will just execute the "threadsforks" file and not do anything else.

INSTALLATION BY USER

A user trying to install the distribution, will most likely not have the Devel::ThreadsForks module installed. This is ok, because then the eval in:

 BEGIN { eval "use Devel::ThreadsForks; 1" or do "threadsforks" }

will fail, and the "threadsforks" file will get executed. And thus perform the test in the user environment. And fail with a message if the version of Perl is not thread-enabled, or does not have the forks module installed.

REQUIRED MODULES

 (none)

AUTHOR

Elizabeth Mattijsen, <liz@dijkmat.nl>.

maintained by LNATION, <thisusedtobeanemail@gmail.com>.

COPYRIGHT

Copyright (c) 2012 Elizabeth Mattijsen <liz@dijkmat.nl>, 2019 LNATION <thisusedtobeanemail@gmail.com>. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.