File::Glob: Dup glob state in CLONE()
authorBrian Fraser <fraserbn@gmail.com>
Sat, 21 Sep 2013 06:19:52 +0000 (03:19 -0300)
committerBrian Fraser <fraserbn@gmail.com>
Fri, 27 Sep 2013 10:37:09 +0000 (07:37 -0300)
commitfacf34ef484d62d15b2da11ee03d01942a22ff15
tree39025babde4eadecc1da89fa2a1193cc8a79c1c6
parentce3470dcce263170c48127c11bb2a47ca92f2616
File::Glob: Dup glob state in CLONE()

This solves [perl #119897] and [perl #117823], and restores the
behavior of glob() in conjunction with threads of 5.14 and older.

Since 5.16, code that used glob() inside a thread had been
unintentionally sharing state between threads, which lead to things
like this crashing and failing assertions:

./perl -Ilib -Mthreads -e 'scalar glob("*"); threads->create(sub { glob("*") })->join();'
MANIFEST
ext/File-Glob/Glob.xs
ext/File-Glob/t/threads.t [new file with mode: 0644]