Calculate the pi by using pthread