merging fix #248 of krakjoe/pthreads