When it looks like a thug, resists arrest like a thug, brandishes weapons like a thug, police have to make a decision to act, or volunteer to remain a target.
There was a story a few years back in NYC involving a teen thug who aimed his Saturday-night special at a cop. Po' De-sha-wan was quickly dispatched with a severe case of lead poisoning courtesy of one of New York's men in blue.
At the press conference afterwards, some idiot reporterette actually asked the NYPD representative why the officer had to resort to deadly force; couldn't he have just "shot the gun out of his hand?"