Add sample code using pthread.