It's actually considered unsporting behaviour and it's a bookable offence and indirect free kick, if the ref chooses to call it.
It's open to interpretation, and I've never seen it happen in professional football, but it happens in Sunday League every now and then.
A friend of mine is a ref and has to deal with it sometimes. You're allowed to shout 'leave it', 'mine' etc but not if you're deliberately trying to put off the opponent.
It's why you don't see it actually happen that often in Sunday League, most guys who play at that level know not to do it.