4 # This file tests interactions with locale and threads
10 require './loc_tools.pl';
11 skip_all("No locales") unless locales_enabled();
12 skip_all_without_config('useithreads');
16 SKIP: { # perl #127708
17 my @locales = grep { $_ !~ / ^ C \b | POSIX /x } find_locales('LC_MESSAGES',
18 'non-problematic-only');
19 skip("No valid locale to test with", 1) unless @locales;
21 # reset the locale environment
22 local @ENV{'LANG', (grep /^LC_/, keys %ENV)};
23 local $ENV{LC_MESSAGES} = $locales[0];
25 # We're going to try with all possible error numbers on this platform
26 my $error_count = keys(%!) + 1;
35 my \@threads = map +threads->create(sub {
39 \$errnum = (\$errnum + 1) % $error_count;
42 # no-op to trigger stringification
43 next if \"\$!\" eq \"\";
46 \$_->join for splice \@threads;",
50 pass("Didn't segfault");