When two or more persons are included in one prosecution, the court may, at any time before the defendant has gone into his or her defense, direct any defendant to be discharged, that he or she may be a witness for the state. A defendant may also, when there is not sufficient evidence to put him or her on his or her defense, at any time before the evidence is closed, be discharged by the court, for the purpose of giving evidence for a codefendant. The order of discharge is a bar to another prosecution for the same offense.
RCW 10.46.110
Conviction or acquittal-Several defendants: RCW 10.61.035.