i used to always get that. i dunno what american schools are like, but when the bell rings, you don't normally have to immediately leave the classroom. that's how we do in pwnway. most of the times it happened, some of my other friends from other classes were already done and waiting for my class to end in the hall, after which they came into the classroom to hook up for the break. i'd just either use force to kill it, or just tell them straight up, "let's chill here for a while, i got a boner".
however, i found that pushing it downwards towards your asshole, although of course not into your asshole, kills it easier. don't overdo it though. you might break it.