Added pthread support.