use readdir and #omp critical