Now pthread version is working (slowly).