B
Bruce Wood
I would hope it does. Otherwise, wouldn't the call to Invoke simply
deadlock? That is, on another thread it would wait for the main thread to
process the Invoke, but if the main thread is waiting already (because
it's the thread calling Invoke) it seems to me it would never get a chance
to process the Invoke.
I've always found it a bit odd that all the "classic" Invoke examples
bother to check that Invoke is required.
Most of the "classic" Invoke examples I've seen do this in order to re-
use the same routine as Invoked or not Invoked, viz: the routine
checks InvokeRequired and, if it's true, Invokes "itself", so the
second go around InvokeRequired will be false and the "else" part will
execute the actual machinery of the method.
Of course, if you use two methods: a facade that calls Invoke and
another method that does the actual work, there's no real need to
check InvokeRequired in the first routine.