What Makes you Yawn?

Have you ever been in a deep conversation with someone whose company you were truly enjoying and all of a sudden you start yawning? Well, I know I have, and while I always thought it was incredibly rude, what I want to know is, do you think yawning is done out of boredom?