Healthy parenting requires adequate self-esteem and in a single mother household -- as with a two parent household -- an attitude of respect for men and women is critical to a son's (and daughter's) development.
Mothers have long been held responsible for their children's development on the one hand, and ridiculed for their closeness to their sons on the other. The "boy code" binds both men and women.
William Pollack supports mothers and fathers in their quest to be close to their son. He acknowledges, rather than criticizes, mothers for their efforts: "...it is not mothers who are crippling our boys masculinity. It is society's myths about manhood that are preventing boys from being seen and trained as whole human beings, men who can work effectively and live in close relationship to other people." (p.98, "Real Boys")
Nurture your sons as much as your daughters. See their strengths and their vulnerabilities. The "boy code" does not by itself cause violence, but it can establish an environment where it can grow.