Does the garbage collector collect until the finalizer at this facility completes before collecting it?
Your question is a bit ambiguous.
When the GC encounters a dead object that needs to be completed, it abandons the attempt to return the dead object store. Instead, it places the object in the queue of "objects that I know need to be completed," and treats this object as live until the finalizer thread executes with it.
So, yes, the GC "waits" until the finalizer is complete before the repository is restored. But he does not wait synchronously. It looks like you are asking: "Is the GC synchronously called by the finalizer?" No, he queues the facility, which will be completed later, and continues the truck. GC wants to quickly complete the task of freeing up memory for garbage and compacting so that the program can resume work as soon as possible. He is not going to stop to deal with some piercing object that needs attention before it is cleaned. He puts this object in the queue and says: "Be calm, and the finalizer thread will deal with you later."
Later, the GC will check the object again and say, "Are you still dead? And is your finalizer running?" If the answer is yes, the object is returned. (Remember that the finalizer can return a dead object to a living one, try never to do this. As a result, nothing nice happens.)
Does it disable threads during finalizer execution?
I believe that the GC is thawing the threads it froze and signals the finalizer thread "hey, you have a job." Therefore, when the finalizer thread starts running, threads that have been frozen by the GC start again.
Perhaps there should be thawed threads, since the finalizer may need the call to be bound to the user thread in order to free up the resource associated with the thread. Of course, some of these user threads may be blocked or frozen; threads can always be blocked by something.
What happens if the finalizer enters a lock held by one of the suspended threads? Is the thread finalizer locked?
You are daughters. There is nothing magical about the finalizer thread that prevents it from being blocked. If the user thread is waiting for a lock fetched by the finalizer thread, and the finalizer thread is expecting a lock fetched by the user thread, then you have a dead end.
Examples of dead ends in the finalizer abound. Here is a good article on one of these scenarios, with tons of links to other scenarios:
http://blogs.microsoft.co.il/blogs/sasha/archive/2010/06/30/sta-objects-and-the-finalizer-thread-tale-of-a-deadlock.aspx
As the article says: finalizers are an extremely complex and dangerous cleaning mechanism, and you should avoid them, if possible . It is incredibly easy to get the finalizer wrong and very difficult to get everything right.