> @gregsfortytwo said:
> This lock isn't redundant; it can just be made smaller by putting it in the submit_message() function. Did you mean to do that and lose some code?

> @somnathr said:
> This is redundant from this function since here we should always be having Connection object present. In ::submit_message(), the if (con) portion doesn't require this lock.
> The lock is necessary in case of overridden sendmessage() that doesn't have Connection object.

That's fine, but we can't have functions which require locking in some cases being called locked sometimes and unlocked others. Switch out the interface to make it be called unlocked, and then lock itself when necessary.