modification to all pthread sync