Executes the given function block while holding the monitor of the given object lock.
Thanks for your feedback!