check lock status and pid in iswritable and isreadable