Changed implementation from phtreads to OpenMP