add several code about pthread.