onanism (n.)

"masturbation," also "coitus interruptus," 1727, from Onan, name of the son of Judah (Genesis xxxviii.9), who spilled his seed on the ground rather than impregnate his dead brother's wife: "And Onan knew that the seed should not be his; and it came to pass, when he went in unto his brother's wife, that he spilled it on the ground, lest that he should give seed to his brother." The moral point of the verse was redirected by those who sought to suppress masturbation. Related: Onanist; onanistic.

Others are reading

Definitions of onanism from WordNet

onanism (n.)
manual stimulation of the genital organs (of yourself or another) for sexual pleasure;
Synonyms: masturbation
onanism (n.)
a method of birth control in which coitus is initiated but the penis is deliberately withdrawn before ejaculation;
Synonyms: coitus interruptus / withdrawal method / withdrawal / pulling out
From wordnet.princeton.edu