It's not. I think johnisgood and loeg both know this, but they're being dangerously simplistic in some of their replies.
If you recognize emission — not just when expulsion is imminent — and if you pull out and that's the end of vaginal intercourse until you've cleared the urethra again, then that's probably nearly perfect at preventing pregnancy.