Devexperts Interview Question

How to prevent deadlock in multi-threading environment ?