To flog one's dong, to flog one's donkey, to flog one's dumber brother, to flog one's mutton, to flog the bishop, to flog the dog, to flog the dolphin, to flog the hog, to flog the infidel and the flog the log ... are (or were) all English euphemisms for masturbation.