Combine file list building and thread processing into single thread