It would be illegal to threaten violence, or some act itself illegal, like an illegal invasion of privacy, slander, etc. It is not so clear cut, however, whether the threat you desribe, which is much more non-specific and does not involve threats of illegal or violent action, is itself illegal. If there is a pattern of threats or ongoing threats, that could be illegal harassment; of if specific illegal acts are threatened, that could give rise to criminal or other liability, but, the described threat, by itself, does not appear to cross that line.