All stratum calls to recv_line are serialised from the one place so there is no need to use locking around recv().
Use a persistent single separate thread for stratum share submission that uses workqueues since all stratum sends are serialised.