Added some of the 4.0 threading enhancements for unity support