A deadlock is a situation in which two processes sharing the same set of resources are effectively preventing each other from accessing the resource, resulting in both program causing to function. Deadlock situation occurs when two or more processes attempt to access resources. which is locked by another process ans there cannot be shared.
Locking of resources, each process has to wait for resource that is locked by another process and as a result one of the transaction can finish.
A set of process is deadlocked if each process in a set is waiting for an event that only another only process in the set can cause.