Green’s Dictionary of Slang

hand jig n.

also three-fingered hand jig
[SE hand + jig, a fidgety movement]

(US prison) masturbation, usu. of one prisoner by another.

[US] in B. Jackson In the Life (1972) 421: They just give hand-jigs or they’ll give blowjobs....They’ll...give each other hand-jigs.
[US]C. Shafer ‘Catheads [...] and Cho-Cho Sticks’ in Abernethy Bounty of Texas (1990) 206: handjig, n. – masturbation. [Ibid.] 216: three-fingered handjig, n. – three fingered masturbation.