robinbowes/flac2mp3 — pull request #6 by carlasplund (2013-01-11 01:09:43+00:00)
Title: Pull request (6 of 8): Race condition: target directory creation

Fixed race condition bug during for creation of target directory
(previous code broken for parallel processing, would sometimes skip
transcoding files). Typically, this bug would occur 2-3 times during
transcoding an 8000 file library.

mkpath() returns 0 if the directory already exists, so between checking
for existence ("unless -d $dst_dir") and attempting to create the
directory ("mkpath($dst_dir)") another parallel process might have
already done it. No reason for aborting the transcoding and skipping the
file.