Код Ревью

Сравни свои решения

    If the order of resource locking cannot be controlled (A always locked before B in any process), you cannot guarantee there will be no deadlocks.