Lock variable synchronization mechanism failed because reading and modifying the the lock variable isn't an atomic operation; so more than one process can read the value of lock variable as 0(i.e. 0 denotes critical section is unoccupied) and enter into the critical section by making the lock value as 1. Hence lock variable doesn't guarantee mutual exclusion. As mutual exclusion is one of the necessary conditions for deadlock to happen, so lock mechanism guarantees that deadlock can't happen as mutual exclusion isn't provided.