For males that have not yet reached the ages for prostate problems, this is generally an "all in your head" type problem, known as psychogenic urinary disorder, and occurs in both males and females, though I'd guess more males have to deal with it because of the lack of privacy of a public urinal (see Male Bathroom Etiquette). It's also apparently quite common, and doesn't solely apply to the unination half of the equation.

I acquired it in my college days, probably from all the community bathroom use. It has since gone away. My prefered method of distraction is multiplying the digits of phone numbers together! :)