fix bug about pthread