Do as much outside of mutex locking of sshare_lock as possible.
Try resubmitting stratum shares every 5 seconds for up to 2 minutes if the pool session id exists and matches on failure to submit.