Fix DisjConditions module to be thread-safe for perl >= 5.7.2.
commitc15d9a8e130cd79e9d79a8ede5a8f431ead5216f
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 19 Oct 2008 17:54:12 +0000 (19 19:54 +0200)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 19 Oct 2008 17:54:12 +0000 (19 19:54 +0200)
tree8c74484dccbd19193c5f7a146d9f723294b0ee86
parentb6af214094ead458695113c17d7a2cade7c54dbc
Fix DisjConditions module to be thread-safe for perl >= 5.7.2.

Self-hashes of blessed references are not correctly transported
through thread creation.  This patch fixes that by recreating
the hashes upon thread creation with a CLONE special subroutine,
which is automatically invoked by new enough Perl versions.
* lib/Automake/DisjConditions.pm (CLONE): New special
subroutine to fix self hashes upon thread creation.
* lib/Automake/tests/Condition-t.pl: New, sister test to
Condition.pl, but spawns a new threads after each creation of a
new condition; skip test if perl is too old or ithreads are not
available.
* lib/Automake/tests/DisjConditions-t.pl: Likewise.
* lib/Automake/tests/Makefile.am (TESTS): Add them.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
lib/Automake/DisjConditions.pm
lib/Automake/tests/Condition-t.pl [new file with mode: 0644]
lib/Automake/tests/DisjConditions-t.pl [new file with mode: 0644]
lib/Automake/tests/Makefile.am
lib/Automake/tests/Makefile.in