Does sex bring on or stop labor?

Jessica
My doctor says it does, but online sites say it can stop it. I'm confused.