Writing the Pseudocode for mutex_lock