In additional to the obvious “get the attention” of a group of people, potential rescuers, command signaling, pet calling, etc., it can serve as a possible deterrent to a would be attacker. Many street survival tactics include yelling, screaming and making as much commotion as possible. The use of a whistle would make the potential attacker aware that their “victim” was not going to silently be taken advantage of, without making a commotion. Also, many whistles produce a blast, that up close is quite uncomfortable to the human hearing, another possible deterrent.
Pete