Major edit, so comments may seem out of place. Sorry for the inconvenience.
It is hard to tell for sure.
Assuming the code looks something like this
public class SomeType {
private static readonly object Lock = new object();
public void Foo() {
lock (Lock) {
Console.WriteLine("in foo");
GC.Collect(2);
GC.WaitForPendingFinalizers();
GC.Collect(2);
}
}
~SomeType() {
lock (Lock) {
Console.WriteLine("in finalizer");
}
}
}
You could get a deadlock if you had more instances of SomeType as they all share a static object for locking. You need to have at least one unrooted and uncollected instance of SomeType and call Foo on another instance.
Now, if you don't have the finalizer as above, I can't see how the code could deadlock.