I actually tried it for a while once, tying myself up at night. Not to prevent masturbation, though. And I know I'm a little nuts.
It doesn't work. Funny how you can't escape your own biology.
The desire will just seek another place to try and break through, till you're an emotional wreck and guilty/self-hating to top it off.