Code Sections 10-7-40 through 10-7-49 shall apply to cases where there is more than one surety, so as to enable a surety discharging a joint debt, in whole or in part, either pending the action or after joint or several judgments, to control the same against his cosureties for the purpose of compelling them to contribute their respective shares of the amount so paid by him.