learn pthread's clean_push and clean_pop function