Error checking mutexes and detection of errors.