Green’s Dictionary of Slang

rosary n.

[the SE rosary is made of decades of prayers]

1. (US prison/Und.) a thirty-day sentence.

[US]A.J. Pollock Und. Speaks 3/2: A rosary, 30 days in jail.

2. (US prison) a sentence to be served for the remainder of one’s natural life.

[US]Goldin et al. DAUL 180/2: Rosary, the. (P) A life sentence in prison.

In phrases

do a/the rosary (v.)

(US Und.) to serve a sentence of imprisonment for the rest of one’s natural life.

[US]Goldin et al. DAUL 60/2: Do the rosary. (P) To serve a life term.
[US]B. Rodgers Queens’ Vernacular 173: do a rosary [...] 2. to serve time.