Let us consider this scenario -
S and T be binary semaphore, where S=1 and T=1;
Process 1 Process 2
wait(S) wait(T)
wait(T) wait(S)
Critical Section Critical Section
signal(T) signal(S)
signal(S) signal(T)
Here if both the processes try to come in the critical section at the same time then both will decrement value of S and T and in the next step they try to decrement value of S and T, then both the processes gets suspended. This situation is deadlock which came due to improper Synchronization