Hi guys I'm improving my knowledge of multithreading C# and was wondering how to solve this classic deadlock issue.

```
public class SomeClass
{
    private object _lock1 = new object();
    private object _lock2 = new object();

    public void Method1()
    {
        lock (_lock1)
        {
            Thread.Sleep(10000);
            lock (_lock2)
            {
                Thread.Sleep(10000);
            }
        }
    }

    public void Method2()
    {
        lock (_lock2)
        {
            Thread.Sleep(10000);
            lock (_lock1)
            {
                Thread.Sleep(10000);
            }
        }
    }
}

```

If two threads run simultaneously there is a risk of a deadlock.

Thanks