Practice for pthread

Learning critical section with pthread.