I would personally never do this. If you stay, it will be different. Everyone, especially your boss will think of you as someone who is about to leave. That's not a good thing.
It's ironic, because anyone could leave for a better job at any time. But actually going through the negotiation/threatening to leave makes it more real.