A deadlock in a computer system occurs when a set of processes are blocked because each one is waiting for another to release a resource. The four necessary conditions for a deadlock to occur are:
1. Mutual exclusion: At least one resource must be held in a non-shareable mode, i.e., only one process can use the resource at a time.
2. Hold and wait: A process holding at least one resource is waiting for additional resources held by other processes.
3. No preemption: Resources cannot be forcibly taken from a process; they can only be released voluntarily.
4. Circular wait: A set of processes exists such that each process is waiting for a resource that the next process in the set holds.
Since all of these conditions are necessary for a deadlock to occur, the correct answer is: \[ \boxed{(D) \, \text{All of the above}} \]