So its a superstition for a captain to "comfort themselves " because unlike their sailor who can go to red light district/prostitute, captains are bound to their ship as husband and wife kind of thing... So yeah, she probably "comfort herself"/ "play with herself"