It depends on the specific implementation. If the calling code is in the same stream as the main lock / DeserializeXml , and it uses the synchronous version ( OnElementDeserializedCallback(...) or OnElementDeserializedCallback.Invoke(...) ), then it will already be inside the existing lock, because the lock by essentially connected to the flow.
If the implementation uses an asynchronous implementation ( BeginInvoke , Task , ThreadPool , etc.), then no: it will not be inside the lock.
If you are not sure, you can block both places (since the locks are repeated, it doesnโt matter if you eventually double-locked the lock from the same thread); however, if it turns out that it is asynchronous, but then tries to join the callback ( Delegate.EndInvoke , Task.Wait , etc.), then it may completely go into a dead end.
source share