Medical Questions? Ask a Doctor Online!
No, you don't really have to tell him that you were masturbating (although, believe you me, we have seen everything you can imagine and it would be better to tell them the entire story). A hernia usually pops out when you increase your intra-abdominal pressure (such as straining or coughing) so a good surgeon would be able to see it and fix it regardless of what you were doing at the time. You probably increased the pressure in your abdomen when you were masturbating.