How Deadlock Can Be Prevented