When two or more threads try to get the lock on the
same lock object, only one can pass, other threads are blocked to a wait state (which does not spend any CPU time until a thread is waken up, by such condition as release of the lock by other threads, abort or timeout), and the threads in the wait state are waken up, according to their positions in the queue. If the lock is done on different lock objects, such thread do not interfere each other at all. "Main thread" or not, never matters.
I answered your question, now, something extra…
Note that your code looks suspicious, at least in terms of practical programming. If you explain your ultimate goals, I'll be able to help you. In the meanwhile, please read my past answers related to thread synchronization used with
System.Windows.Forms
and beyond:
Problem with Treeview Scanner And MD5[
^],
Control.Invoke() vs. Control.BeginInvoke()[
^].
—SA