Add sample code for pthread.