I was sure it had something to do with sex. I mean, if you think of the thumb as a cock it kinda makes sense, and it certainly FEELS like a crude gesture.
Where did I see it, hmm?
Ah yes - a chapter in Yakitate!! Japan. Tsukino was really shocked and embarassed when Azuma did it.